Welcome to PFrank

Welcome to PFrank, a powerful bulk file renaming tool. A brief summary describing the features of this utility can be found in the Readme file

The reasons for creating PFrank are here.

There are of course other renaming tools available but hopefully you'll find the power and flexibility of PFrank irresistable. There are not many other renaming tools which give you the capability to fix all your music filenames with the click of a button or run pre-defined and regular expression based renaming commands in a sequence. If you aren't already familiar with using regular expressions, it is well worth the time to learn them. It doesn't take long to learn the basics. Help information about regular expressions is provided in the Regular Expressions section. The section contains many examples which can be easily copied and pasted into the tool's main window.

Hope you have as much satisfaction using the tool as I had in developing it.

Enjoy!

Peter Frankenberger


Readme

Readme Text


Why?

The motivation for developing PFrank came about for several reasons.

  • I had done alot of programming up until about 7 years ago but had not done much other than the odd script since then. I was looking for a major make-work project so that I could resurrect programming skills of old.
  • I had been using stream editor (via Cygwin) based scripts to handle bulk renaming of files. Developing a bulk renaming tool that runs under Windows seemed like an interesting project and one that would fill a need.

The Python programming language had been suggested as a powerful language with which to do PC programming. After some research, it was apparent that Python in conjunction with wxPython had all the features that were required. Both are also well supported by an active user community plus both have on-line availability of a wide variety of source code, demo software, and tutorials.


Contacts

If you have any comments, questions, or suggestions for improvements then please let me know. If you have opinions regarding aspects of the program that you do not like, then I would like to know that too.

I try to ensure that whatever I release will be of the highest quality. The code is highly maintainable so it is easy to add features without breaking others. I have set up an automated test suite to comprehensively test the renaming core especially for the music renaming. I rigorously test the gui manually. Some day I would like to set up an automated test suite for the gui. I also have some volunteers verifying the program. If, in spite of my efforts for quality, any bugs slip through the cracks, then I definitely would like to hear about it. Please include the following information with any bug report:

  • Version of PFrank
  • Type of operating system (e.g. Windows 95/98/ME/2000/NT/XP)
  • Copy of the PFrank log file. See the installation page for information on where the log file is located.

I can be contacted at: jccfifkf@yahoo.com

A Forums site is available at: http://pfrank.s4.bizhat.com.

The official Web site is at: http://www3.telus.net/pfrank.

Credits


Credits

Designed and Programmed by

Peter Frankenberger

Copyright (c) 2004, 2005, 2006, 2007 by Peter Frankenberger

The help sections on regular expressions contain many excerpts from A.M.Kuchling's 'Regular Expression HOWTO' found at http://www.amk.ca/python/howto/regex.

The audio and image meta-data extraction features are derived from the mmpython, eyeD3, and EXIF python packages.
The EXIF Tag comment write feature is derived from the jpeg win32 python package.

Special thanks to the following for testing the product:

Greg Cooper
Colin Randall
Donny Kwan
Cam Livingstone
Imran Dewji
Popeye Theophilus Barrnumb
Alex C. Smith
Mark Marziale


Installation

Run the installation program by double-clicking on the PFrankSetup file. This will by default, create a folder called PFrank under your "Program Files" folder (or the equivalent folder for Vista). You have the option to install PFrank in another folder (if you are a user without admin privileges, you will have to choose a different folder). The program executable can be accessed from this folder or if chosen, can be accessed via the Start menu under Programs or from the Quick Launch bar. The Start menu contains shortcuts to the PFrank program, Help documentation, and the PFrank uninstall program.

You have the option to not include any additions to the registry. The additions would be required to enable the activation of PFrank by right-clicking a folder and choosing PFrank from the resulting context menu. If you are a user without admin privileges, you will have to choose not to modify the registry in order to install PFrank.

A configuration file called "Config" which stores the user configuration will by default also be created under a second PFrank folder. This folder is located under the "Application Data" folder (or the equivalent folder for Vista). The location of the "Application Data" folder is dependent on the operating system.

You have the option to configure PFrank to be runnable as a program on portable devices like thumbdrives. PFrank will then store the Config, log, and other utility files in the install folder rather than the 'Application Data' folders.

  • For Windows Vista systems, the path to the "Application Data" PFrank folder is usually: C:\Users\<username>\AppData\Roaming.
  • For Windows XP/2000 systems, the path for the "Application Data" PFrank folder is usually: C:\Documents and Settings\<username>\Application Data.
  • For Windows NT systems, the path for the "Application Data" PFrank folder is usually: C:\Winnt\Profiles\\<username>\Application Data.
  • For Windows ME/98 systems (profiles disabled), the path for the "Application Data" PFrank folder is usually: C:\Windows\Application Data.
  • For Windows ME/98 systems (profiles enabled), the path for the "Application Data" PFrank folder is usually: C:\Windows\Profiles\<username>\Application Data.
  • For Windows 95 systems, the path for the "Application Data" PFrank folder is usually: C:\Windows\Application Data.

A logfile called "PFrank.log" which stores records of unexpected events is created under the "Application Data" PFrank folder.

If there are startup errors, a logfile called "PFrank.exe.log" is created under the "Program Files" PFrank folder.

Portability

The location of the Config file, PFrank.log file and other utility files generated by PFrank can be controlled by editing a file called ConfigLocation. The ConfigLocation file is found in the PFrank install folder. This file contains the path (relative or absolute) of the folder in which the utility files are to be stored.
e.g. if the ConfigLocation file stores a '.', then the Config file for example, will be stored in ./Config relative to the install folder (i.e. in the install folder). In this case, if the install folder is located on a portable device like a flash drive, then the utility files will always be created in that folder. You can then move PFrank around in the flash drive and the utility files will stay with the drive.

If you use the installer to install PFrank to run as a portable program, the installer just arranges for the ConfigLocation file to have a '.' in it.

UPX

PFrank will occupy less space on your portable device if you compress the executable files with the Ultimate Packer for eXecutables (UPX) compression tool. UPX is not included with PFrank but can be downloaded from: here.
Once downloaded, just run a .bat file with the following commands:

upx --best *.pyd *.dll PFrank.exe

Do not run UPX on the unins000.exe file since the resulting compressed uninstaller will not run.

Uninstall

You can uninstall PFrank either by double-clicking the "Uninstall PFrank" icon under the start menu mentioned above, or by invoking the windows control panel, double-clicking on add/remove programs, and then choosing the PFrank item. When uninstalling, the PFrank folders and their contents are removed. This would include the any saved configuration files if they are in the PFrank folder. Any associated register entries are also removed.

Installing New Version

Unless specified otherwise, you can install new versions of PFrank without uninstalling previous versions.

One Instance Per User

Only one instance of PFrank should be run per user. This prevents uncoordinated access to the configuration file. If you attempt to run multiple instances, you will see a message box pop up warning you of the multiple instances. It is up to you if you wish to continue but you risk losing Config file data.


License

License Text File


Release notes

For a version history of this product see What's New

For a description of known issues of this product see Known Issues


What's New?

Version 2.02, July 15, 2007

  • Upgraded music library.
  • Fixed problem with column display.
  • Added a few tweaks.

Version 2.01, July 2, 2007

  • Now easier to fill lists with data.
  • Other minor improvements.
  • Fixed sorting problem.

Version 2.00, July 1, 2007

  • Unicode improvements.
  • Minor bug fix with sample preview display.
  • Minor bug fix with Force case tables.
  • Other minor improvements.

Version 1.99, June 15, 2007

  • Name filter improvements.
  • Regex-based filters now have to match the entire name.
  • Added new option for Force Case.
  • Added new dupe handling option.
  • Other minor improvements.

Version 1.98, June 1, 2007

  • Moved File/Folder filters to main window.
  • Fixed path builder bug introduced in 1.97.
  • More shortcut keys and other various minor improvements.

Version 1.97, May 15, 2007

  • Removed restriction on regex group naming.
  • Fixed upgrade bug.
  • Fixed problem with Ins and Del custom list shortcuts.
  • Other various minor improvements.

Version 1.96, May 1, 2007

  • Added auto-update to the sample preview
  • Added Installer improvements.
  • Added more keyboard shortcuts and other refinements.

Version 1.95, April 15, 2007

  • Integration with explorer context menu is now optional.
  • Added another pre-defined regex command.
  • Added stubs for user command file.
  • Non-admins can now install PFrank to local folders.
  • Added portabiltity.
  • Fixed problem with leading numbers in Forced Case tables.

Version 1.94, March 31, 2007

  • Added more pre-defined regex commands
  • More optimizations.

Version 1.93, March 8, 2007

  • Added more pre-defined regex commands
  • Various optimizations.
  • Upgraded Installer.
  • Fixed startup bug introduced in 1.91 that occurs on Win98/95 systems.

Version 1.91, February 28, 2007

  • Added post-processing feature.
  • Added more Help Options.

Version 1.90, February 14, 2007

  • Added the ability to add User Defined Commands.
  • Switched to much improved Help Controller.
  • Added new options and improved feedback to command line interface.
  • Fixed bug with date formatter.

Version 1.89, February 1, 2007

  • Added new counter and insertion options.
  • Added more pre-defined regex sequences.
  • Many gui improvements.

Version 1.88, January 20, 2007

  • Added auto column enable options.
  • Added more pre-defined regex sequences.
  • Added 'Name Properties' group for column display.
  • Can now resize thumbnail using F7/F8.
  • Added new counter option.
  • Many minor GUI improvements.
  • Fixed bug with escape not exitting row editing.
  • Fixed bug with reversed row order in pre-defined regex sequences.

Version 1.86, January 2, 2007

  • Replaced 3 custom lists with a list manager that can manage many lists.
  • Improved error feedback for invalid filter patterns.
  • Tooltip configuration now saved.
  • Upgraded wxPython library to 2.6.3.3.

Version 1.85, December 9, 2006

  • Added ability to insert Pre-Defined Regex sequences (use right click on custom list).
  • Can now change font size of preview list.
  • Can now specify unicode codecs for exported files.
  • Fixed problem with current folder entry losing current selection.

Version 1.82, November 22, 2006

  • Decreased size of executable by splitting off SVN support into a separate version.
  • Updated installer.

Version 1.81, November 11, 2006

  • Can now drag names from Explorer to the preview window.
  • Fixed bug with incorrect insertion option shown in custom summary.

Version 1.80, October 29, 2006

  • Can now specify unicode decoders for imported files.
  • Other various minor improvements.

Version 1.79, October 6, 2006

  • Added email meta-data insertion.
  • Fixed early termination bug in command line interface.
  • Fixed minor bug with file select dialog.

Version 1.77, September 21, 2006

  • Added Name Exclusion Filter.
  • Fixed bug with command-line driven custom commands being executed in reverse order

Version 1.75, September 9, 2006

  • Fixed bug that occurred when changing name filter type.
  • Other applications can now use the Escape key while PFrank is running.

Version 1.74, August 28, 2006

  • Improved error handling for invalid regex.

Version 1.73, August 19, 2006

  • Added new insert counter option.

Version 1.72, August 12, 2006

  • Fixed bug with editing new name and scrolling.
  • Fixed bug where a hidden column might reappear.
  • Fixed PFrank startup bug when right clicking on folder.
  • Fixed broken command line interface.

Version 1.71, July 19, 2006

  • Added more video meta-data insertion.
  • Split Image tag and non-tag meta-data into separate groups.
  • Image width/height now detected for more image types.

Version 1.70, July 12, 2006

  • Added new regular expression flags to control number of replacements and whether to include the extension.
  • Fixed bug with column configurator always displaying the default column order on restart.
  • Fixed bug with processing of unparsable music tags.

Version 1.69, July 5, 2006

  • All columns can now be exported to csv file.
  • Added lots more EXIF meta-data insertion for image files.
  • Fixed display of some EXIF meta data.
  • Fixed program hang problem with processing of tags from some camera types.
  • Fixed problem with handling of incorrect format codes.
  • Changed default order of columns and default sorting.

Version 1.68, June 28, 2006

  • Added Exif GPS meta-data insertion for image files.
  • Optimized meta-data insertion for exif and iptc.
  • Improved logging for custom scans.

Version 1.67, June 21, 2006

  • Added IPTC meta-data insertion for image files.
  • Switched position of 'insert into list' and predefined 'scan' button.

Version 1.66, June 14, 2006

  • Added checkboxes to enable/disable custom renaming rows.
  • Other minor improvements.

Version 1.65, June 7, 2006

  • New Column Configuration controller.
  • Added Path Builder feature.
  • Fixed startup problem sometimes seen on Win9x/ME systems.
  • Fixed problem with Main Window Sash.

Version 1.63, May 25, 2006

  • Added more image insertion meta-data.
  • Improvements to Exif/Image information insertion and other features.

Version 1.62, May 18, 2006

  • Added Hash Information insertion.

Version 1.61, May 13, 2006

  • Support more image types.
  • Fixed bug with DateTimeOriginal.

Version 1.60, May 11, 2006

  • Added Context-based Help.
  • Optimized Preview Update Display.
  • Improved File Properties Modification interface.
  • Fixed bug with windows disappearing.

Version 1.59, May 5, 2006

  • Added DOS name insertion option.
  • Fixed bug with Tag Version Music column.

Version 1.58, April 28, 2006

  • Added more image insertion options.
  • Added more preview display options.
  • Fixed bug with null string for missing info.

Version 1.57, April 21, 2006

  • Added more music insertion options.
  • Upgraded installer.
  • Fixed bug with sorting of some columns.
  • Fixed bug with wav file audio length.

Version 1.56, April 14, 2006

  • Added office properties insertion options.
  • Improved Force Case option panel.
  • Fixed bug with saving last sorted option.

Version 1.55, April 8, 2006

  • Improved parent folder insertion.
  • Upgraded Python library to 2.4.3, wxPython library to 2.6.3.2, and MP3 library.

Version 1.54, April 3, 2006

  • Added improvements to Detailed Information Window display and it's menu options.

Version 1.53, March 28, 2006

  • Moved Date Formatter to it's own Option Panel. Changed 'Date Insertion' command to 'File Properties Insertion' command.
  • Can now insert and change multiple file properties.
  • Added ability to insert file size property.
  • Added more logging messages.
  • Minor gui enhancements.
  • Fixed minor bug with force case table.

Version 1.52, March 11, 2006

  • Added support for insertion of tag information and meta-data for Video.
  • Added command line options to perform custom renaming.
  • Minor bug fixes.

Version 1.51, March 2, 2006

  • Added support for insertion of tag information and meta-data for Ogg Vorbis, Flac, and other music file types.
  • Optimized processing time for EXIF tags.

Version 1.50, February 24, 2006

  • Fixed bug with inserting EXIF tags.

Version 1.49, February 23, 2006

  • Added insertion of title tag information from HTML (or other markup-language) files.
  • Minor display updates.
  • Fixed bug to refresh columns after renaming.

Version 1.48, February 16, 2006

  • Added exif and mp3 comment columns (off by default).
  • Can edit exif and mp3 comment to add original name or other info.
  • Can globally enable/disable tooltips.
  • Added size and attribute columns (off by default).
  • Upgraded MP3 Tag library
  • Fixed bug with hiding columns.

Version 1.47, February 13, 2006

  • Added importing of old/new name pairs.

Version 1.46, January 25, 2006

  • Fixed bug with predefined insertion into custom list.
  • Fixed bug with rescan button.

Version 1.45, January 23, 2006

  • Added support for Subversion (SVN) (off by default).
  • Added icons in Detailed Information Window.
  • Reorganized Help Info into small pages for easier searching.
  • Bug Fix to remove import of pysvn for Windows 95/98 systems.
  • Upgraded wxPython library to 2.6.2.1.

Version 1.43, December 20, 2005

  • Added more features for moving rows.
  • CSV Export now supports more columns.
  • Can now insert Specialized Renaming commands in custom list.
  • Changed some terminology for Force Case tables.
  • Fixed Unicode problem with MP3 Tag insertion.

Version 1.42, November 24, 2005

  • Added Unicode Support.
  • Added button for insertion of Pre-defined renaming commands into Custom List.
  • Window positions now saved automatically.
  • Splitter sash position for main window (between custom and summary panels) now saved automatically.
  • Various minor enhancements and optimizations.
  • Upgraded MP3 Tag library
  • Upgraded WxPython library to 2.6.1.0.

Version 1.37, November 6, 2005

  • Added draggable rows (but no drag image yet).
  • Fixed bug with detailed info window and moving down 1 row.

Version 1.36, October 30, 2005

  • Changed 'renumber' function in the detailed info window to a more general purpose 'redo scan' button.
  • Fixed display bug when deleting first entry of preview list.
  • Fixed bug with summary panel display.

Version 1.35, October 22, 2005

  • Added MP3 tag columns to preview list.
  • Added EXIF tag columns to preview list.
  • Added File Creation Date column to preview list.
  • Made display of any of above columns user configurable.
  • Added more mouse click controls to preview list.
  • Optimized memory usage.
  • Fixed bug with cancelling manual edit.

Version 1.31, October 12, 2005

  • Reorganized keyboard shortcuts.
  • Split main window into a splitter window. Sash is above summary panel.
  • Fixed a bug with manually renaming to a duplicate file.

Version 1.30, October 7, 2005

  • Can now renumber the preview list after rearranging rows of the detailed information window.
  • Can now sort using numeric based sorting (sometimes called natural sorting).
  • Added ability to move individual rows or groups of rows up or down.
  • Added icon buttons for moving/deleting list rows.
  • Can now randomize row positions.
  • Other minor gui updates
  • Upgraded Python library to 2.4.2.
  • Fixed bug with "Clear Summary"
  • Updated Help Information.

Version 1.24, September 27, 2005

  • Added Pre-Defined Commands for removing trailing and leading whitespace.
  • Made separate set of 'Force Case' tables for Case Replacement commands
  • Added Highlighting of codes in custom patterns.
  • Enhanced 'Name Filter' configuration interface.
  • Custom Renaming list now larger and expandable.
  • Other minor gui tweaks.
  • Fixed bug with custom previewer that occurred when previewing full path names and multiple custom commands.

Version 1.20, September 20, 2005

  • Added Force Case of Words Table option for Case replacement commands (shared with music tables)
  • Added highlighting for manually changed entries.
  • Added 'Old Length' and 'Old Full Path Length' columns to detailed information window (column display for these is off by default).
  • Added 'New Full Path Length' column to detailed information \ window.
  • Can now Drag'n Drop folders into current folder field, custom renaming 'sample text' field, and the Favourite Folder's list.
  • Last sorted column of detailed information window can now be saved automatically.
  • Pathname terminology now includes the filename.
  • Fixed bug with scanning blank list in custom renaming.

Version 1.15, September 12, 2005

  • Added Pre-defined command for 'Sentence Case'.
  • Added Hex Code viewing option for Old/New Name pairs.
  • Added Hex Code to Character Conversion Display window.
  • Minor display fix.

Version 1.10, August 30, 2005

  • Made master reset button available on main window file menu.
  • Fixed incompatability of 1.05 with old versions.
  • Updated some tooltips.
  • Updated Help Information.

Version 1.05, August 25, 2005

  • Added regular expression previewer.
  • Added ability to enter/paste text for the current folder name.
  • Fixed window flipping when responding to some kinds of error input.
  • Fixed bug configuring subfolder exclusion filter.
  • Changed keyboard shortcut for custom renaming from CTL-C to CTL-K.

Version 1.01, August 9, 2005

  • Fixed bug with sorting of 'Problem' column.
  • Fixed bug that occurs after closing Help Window.
  • Added more regex examples to help.

Version 1.00, July 8, 2005

  • Added 'Last Modified Date' column to detailed information window.
  • Fixed bug in which configuring null strings for missing tags did not work as exected when missing tag warnings were also enabled.
Version 0.73, January 21, 2005

  • Initial beta version.
    Developed using Python 2.4 and wxPython 2.5.3.1.


Warnings and Known Issues

Warnings:

Users should be aware of the following:

  • The program can be very memory intensive especially if a scan results in many tens of thousands of files listed for replacement. If you don't have sufficient memory, then the performance of the tool during scans could be slow. Rough figures for peak memory used during a scan are listed below:
    • After initialization - 6M
    • Scanning resulting in 0 replacements found - 8M
    • Scanning resulting in 8,800 replacements found - 14M
    • Scanning resulting in 46,000 replacements found - 44M
    • Scanning resulting in 230,000 replacements found - 165M

  • PFrank has been designed to work on Windows Vista, XP, 2000, NT, ME/98(with or without user profiles enabled), and Windows 95. The program has been tested with the following Windows operating systems:
    • Windows Vista
    • Windows XP (professional and home)
    • Windows 2000
    • Windows ME (profiles disabled)
    • Windows 98 (profiles disabled)
    • Windows 95

Bugs:

  1. It is possible to open multiple help windows.
    Workaround: Don't do it; you only need one.
  2. The icon column of the Detailed Information window does not show icons for shortcuts. Also, if you had files with a ".xxx" extension and associated it with program XYZ by using the MS Explorer, right-click a ".xxx" file, select "Open with...", select program XYZ, and told Explorer to "always use that program to open ".xxx" files". Explorer will show all ".xxx" files with XYZ's icon but PFrank will show whatever the original default program was.
    Workaround: None.
  3. Sometimes the bitrate, duration, and type are displayed incorrectly for mp3 files of a multi-track CD. ALBW format is OK.
    Workaround: None.
  4. Cannot set file attributes for files/folders with unicode names.
    Workaround: None.


Future

The sky is the limit. Just let me know what you'd like. Some possible new features are:

  • In Specialized Renaming, add support for more music file types.
  • Support more types of meta-data.

If you have any suggestions then please contact me.


User Interface

  • Help Information
  • Scanning and Renaming
  • Resetting All Configurations
  • Unicode

The main window appears when PFrank is run. It contains a menu bar at the top with several panels below it. A status bar is at the bottom of the window. Other windows can appear depending on selections made by the user. The other windows are the Options Window and the Detailed Information Window.

Selectable controls (e.g. buttons, radio buttons, pull-down lists, etc.) in the windows can be used to access various features.

PFrank has many built-in keyboard controls. All the menu controls have keyboard shortcuts. Many buttons have built-in shortcuts; the key sequence of a button shortcut is specified in the tooltip for the button. The standard windows editing shortcuts, CTL-C (copy), CTL-X (cut), CTL-V (paste), and CTL-Z (undo) will work on any of the controls that are editable. The option selector controls of the Option Window all have keyboard shortcuts. See the Keyboard Shortcuts section for a complete list of shortcuts.

Some keys are used to navigate around windows. TAB and SHIFT-TAB are used to navigate the selectable controls. Arrow keys are used to navigate selections of checkbox controls, list controls, and radio button controls. The '-' and '=' keys are used to control whether checkbox entries are checked or not. ALT-DownArrow is used to open the pull-down list of list controls or combo box controls.
The following shortcut keys are used to navigate between windows. Pressing ALT-O from any window will raise the Options Window. Pressing ALT-W from any window will raise the Main Window. Pressing ALT-D from any window will raise the Detailed Information Window.

Help Information

Many of the selectable controls provide a tooltip window when the cursor is placed over them. The tooltip provides a brief explanation of what the control is used for or how to use it.

The tooltip information can also be activated by using the context-based help button. This is the '?' button that appears on every window. After pressing the '?' button a '?' image appears that can be moved with the mouse. Move the image to the button or controller of interest and press the left mouse button to show the information. Information also appears in some of the blank areas to explain the function of the area in question.
Context based help can also be activated by selecting a control and then pressing F1. In most cases the control can be selected by left clicking with the mouse. But clicking with the mouse will not work on button controls since the function of the button will instead be activated. You can instead use tab navigation to select the control before pressing F1.

Comprehensive On-Line help documentation is also available by pressing ALT-F1 while in any of the main windows.

Scanning and Renaming

Scan buttons appear in the various search/replace panels. Scanning will be performed in the current folder (which is configurable) and in it's subfolders (this is a configurable option). Files/Folders will be filtered according to the Filter configuration. Note that Files encompasses all non-folder entities. e.g. Files and Shortcuts When scanning is in progress, the status bar indicates the progress of the scan. Various configurations and functions that could interfere with a scan are disabled while a scan is in progress. When scanning is completed an internal list of renaming commands is produced. The internal list is used later to carry out the renaming.

PFrank produces errors if files will be renamed to the same names as already existing files or if files will will be renamed to the same name that other files are being renamed to. The error is also produced if new filenames are different from each other but the only differences are in the cases used by the letters. The same happens if new filenames are different from existing filenames but the only differences are in the letter cases. These naming conflicts can, if enabled, be automatically resolved by adding a .PFxxxx string where xxxx is a unique four-digit number. The user has control over where the string is placed. The 'PF' part of the string can be replaced using a configurable option If naming conflicts are resolved, then the conflicts are labelled as warnings instead of errors.
The user can also resolve the renaming conflicts manually beforehand to avoid filenames including the autoresolving strings.

PFrank produces errors if new filenames contain unprintable characters. This is possible using regular expressions or if inserted tags have invalid characters. In such cases, the internal list will be stripped of the invalid renaming sequences. It is left to the user to modify the regular expression so that the invalid characters are not produced.

At the same time that the internal renaming list is created, an internal undo list is also created. This can be used to undo renaming done by the renaming. Only one level of undo is available.

If any errors are detected, then the renaming commands will not be included in the internal renaming list or undo list.

A detailed list of information is produced in the Detailed Information window for viewing files to be renamed. The Detailed Information window automatically pops up after a scan. The list in the window contains information regarding any errors or warnings raised including resolution of filename conflicts. Renaming can be carried out from the detailed information window.

Renaming of a file will not affect its last modified date.

Resetting All Configurations

If desired, all options and main window settings can be reset to their defaults by pressing the keys CTL-ALT-R simultaneously. The user is then prompted for confirmation.

Unicode

PFrank supports unicode character formats.


Main Window

  • Menu Bar
  • Current Folder Panel
  • Name Filter Panel
  • Specialized Renaming Panel
  • Pre-Defined Regex Panel
  • Pre-Defined Command Panel
  • Custom Renaming Panel
  • Summary Panel
  • Status Bar

The main window appears when PFrank is run. It contains a menu bar at the top with a series of panels below it. The figure below of is the appearance of the window on Windows XP systems.


Main Window Current Folder

Current Folder Panel

The current folder panel is used to display the currently selected folder and to choose new current folders. The folders can be selected by using a browse button, dragging and dropping a folder icon into the text field, or by entering the folder name in the text field. If using the text field, then press the Enter key or click one of the buttons on the window to finalize the entry. When a new folder is configured in the text field it is added to the pull- down menu.

If PFrank is executed by right-clicking the mouse on a folder and then selecting PFrank, the current folder will be set to the folder that was clicked. Otherwise, if PFrank is executed by double-clicking a PFrank icon, using Quick Launch, using the Start Menu, etc., the current folder will be set to the last accessed folder.

The entries of the pull-down list are saved automatically for the next PFrank session. The list can be edited using the favourite folder configuration option available under the options menu.


Main Window Custom Renaming Panel

Custom Renaming Panel

When scanning with custom renaming, files are first filtered using the file filter. The files passed by the filter are then scanned for potential replacements. The types of replacements found are based on the python-style regular expressions (regex) or pre-defined commands chosen in the search and replace fields. You can enter any regex you like or use the 'Insert in LIst' button to choose from the pre-defined regex or command lists. The use of regex expressions along with many examples is described in the Regular Expressions section.

The regex expressions are entered manually in a list using an editor. Press F12 or Double click with the left mouse button on a search or replace entry to activate the editor. Enter the expression and then use any of the following to save the entry:

  • press enter key (also closes the editor)
  • click the mouse outside the area being edited (also closes the editor)
  • press F12, TAB, SHIFT-TAB, an up or down arrow, SHIFT-Home, or SHIFT-End key (also keeps the editor open at the next entry)
Press ESC to exit the editor without saving.

Right clicking the mouse over the list but away from the row being edited makes other commands available for inserting, removing, enabling, disabling, or moving rows, or adding any of the pre-defined renaming commands, specialized renaming commands, or pre-defined regular expression sequences.
When adding pre-defined or specialized renaming commands, the commands are placed in the "replace pattern" column. The command sequence uses a custom syntax. The first argument is the command and the second argument is the first parameter of the command. The arguments are delimited by "*"s. When a pre-defined command in the "replace pattern" column, the "search pattern" column must remain blank or the pre-defined command becomes invalid.
Adding pre-defined regular expression sequences will insert a row or multiple rows of regular expressions to accomplish tasks like removing vowels, or removing prefixes, etc.
An exit command can also be inserted. The exit command will force the search/replace sequence to quit at that point. This can be useful when debugging a sequence of regular expressions.
A command is available for swapping the search and replace columns. This can be handy if you are creating transliteration sequences. The command menu can also be made available by pressing SHIFT-F10 after the panel is selected.
A command is available to undo the last list update. This is handy if you accidently do something like delete or clear all the rows or load a saved list overtop of the current list; the undo command will undo that last command (or redo it). The undo is, however, only 1 level deep.

Right clicking the mouse over the row being edited makes other options available for copying/pasting/undoing/redoing entry data.

Selected rows can be moved by clicking on the down-arrow or up-arrow icons or by dragging with a mouse. Multiple rows are selected by pressing CTRL or SHIFT at the same time as pressing the left mouse button.

The search/replace scanner will serially invoke each search/replace expression pair in sequence with the output of a search/replace pair being used as input to the following search/replace pair.

Each row has a checkbox on the left-hand side. This is used to enable/disable the row. If the box is checked, then the row is enabled. If the box is blank, then the row is disabled. Disabled rows are skipped during a custom scan. This can be useful for debugging the sequence.

Search/replace information can be inserted in bulk from the clipboard by using the CTL-F2 command. See the Summary Panel information for more details.

Working Through an Example

The table below shows an example custom renaming sequence:

Search Pattern | Replace Pattern
%20 |
 | *Insert Counter Before*Extension*
abc | ABC
 | *Insert Counter Before*Prefix*

The first row deletes all occurrences of the string '%20'. The second row is a pre-defined renaming command which takes the names that have had the '%20' removed and inserts a counter before the filename extension. The third row takes the names that have just had the counters added and translates all occurrences of 'abc' with 'ABC'. The fourth row is a pre-defined renaming command which takes the resulting names and inserts a counter (the same counter as inserted by the command in row 2) before the filename prefix. It is only at this point that checks are made for potential problems such as duplicate names.

Previewing Sample Names

The output of the custom renaming sequence can be applied to sample names and previewed. This is done by typing some sample text in the "Sample Name" field or dragging a file/folder icon into the field. The custom renaming sequence will then be applied to the sample text and output to the "Preview" field. If there are any errors in regular expression used in the custom list, then the preview text will be blank. The reason for the error will be displayed if you press the scan button or if you type any characters (including 'Enter') in the sample name.

The renaming will be applied as follows:

  • If the sample text is the name of a real file with full path specified, then it will be treated as a real filename. The custom renaming commands will be applied to the portion of path after the last slash character.
  • You can also just type the name of a file or subfolder without a path component into the sample text. The sample text will then be treated as if the name is a file or folder belonging to the currently selected folder. The custom renaming commands will be applied to the typed text.
  • If the sample text includes path separators and the path is invalid, then any predefined renaming commands in the custom list that depend on meta-data being present in the file will not have any effect. The renaming commands will only be applied to the text after the last path delimiter.
Note that both slashes or backslashes in the sample name are treated as path delimiters.

Saving/Loading Custom Lists

Using the list manager panel, the rows of the custom list can be saved into a list set. You specify the name of the list and press the 'Save' button. If the name is new a new list will be stored. If the name already exists, the existing list contents will be overwritten. Use the 'Load' button to load the contents of a saved list into the displayed rows. After loading or saving, the name of the list will be highlighted to indicated that the displayed rows correspond to the named list. Once any change is made to the rows the highlighting will be removed. A 'Delete' button is available to delete any of the saved lists.

When restarting PFrank, the list entries, the preview sample text, and the three sets of lists will be restored to what they were before.

If you move the mouse between the bottom of the custom renaming panel and the top of the summary panel (see next section), you will find a sash which can be used to control the height of the summary panel.


Main Window Menu Bar

Menu Bar

From the Main Window menu bar, users can:

  • Save all current configurations to a file.

  • Load configurations from a file.

  • Clear the summary information.

  • Import filename or foldername pairs from a file. The pairs are composed of an old name, a separator, and a newname. The separator must be a comma. Typically, the file would be a csv file. Do not put any whitespace before or after the comma separator since the whitespace will be assumed to be part of the old or new name.

    e.g. c:\music\oldname.mp3, newname.mp3

    If an old or new name has comma's in it, then the entire name must be surrounded in double quotes.

    e.g. "c:\music\artist - this is the old song, 1978.mp3", newname.mp3

    The old name must include full path information; if it does not, then the current folder is assumed. The new name can have full path information but the base path must match that of the old name. The pairs are scanned for validity and then loaded into the detailed information list so that the old names can be renamed to the new names.

  • Save the summary information to to file.

  • Reset all configurations to their default values.

  • Run scan using the currently selected pre-defined command from the pre-defined command panel.

  • Run scan using the specialized Flac renaming (this performs the same function as pressing the Flac Scan button).

  • Run scan using the specialized MP3 renaming (this performs the same function as pressing the MP3 Scan button).

  • Run scan using the specialized Ogg renaming (this performs the same function as pressing the Ogg Scan button).

  • Run scan using the custom renaming list of the custom renaming panel (this performs the same function as pressing the Scan button in the custom renaming panel).

  • View the Detailed Information Window.

  • View the Option Window.

  • View a Hexadecimal codes to characters Table.

  • View the custom renaming row commands. This is the same thing you get by right-clicking the mouse over the custom list.

  • Access Built-In Help documentation.

  • Access the tip of the day.

  • Globally enable/disable the tooltips associated with the controls.

  • Access the donation dialog and the program revision information.


Main Window Name Filter Panel

Name Filter Panel

The name filter is used to isolate groups of files or folders which are to be scanned by the different search/replace renaming methods. Some configurable options for the filter are on the main window and the remainder are in the Option Window Name Filter panel.

Files and/or Folders

Filtering can be configured so that scans isolate files, folders, or both

Patterns

Names can be filtered or isolated using patterns. Filter patterns can be specified as python style regular expressions (see Regex Expressions section for more information) or unix wildcard expressions (see Unix Wildcard section for more information). Patterns can be chosen from the defaults available in the pull-down menu of the Name Filter panel or can be configured in the text field of the panel. If configuring the text field, then press the Enter key or click one of the buttons on the window to finalize the entry. When a new filter is configured in the text field it is added to the pull- down menu.

When restarting PFrank, the current filter pattern will be set to the last accessed pattern. The entries of the pull-down list are saved automatically for the next PFrank session. The list can be edited using the favourite filter configuration option available under the options menu.

Filter Bypassing

Name Filtering is overridden or bypassed when performing a music scan. The music scans use filtering specific to the type of music file.


Main Window PreDefined Regular Expression Panel

Pre-Defined Regex Panel

Pre-defined regular expression (regex) sequences are available for insertion into the custom list. These include simple examples that can be used to help brush up or learn regular expression usage. The sequences can be used as is or can be inserted and then modified in any way. For example, there is a sequence available for removing the first 4 characters of a prefix. If you want to instead remove the first 6 characters, then just insert the 4 character sequence and then change the 4's in the sequence to 6's.

Pre-defined regular expresssion sequences are available to:

  • remove characters from the start or end of the filename prefix or entire name.
  • remove vowels or numbers.
  • remove accents from characters.
  • transliteration.
  • swapping fields, truncation, plus other functions.

The pre-defined regex sequences can be inserted into the custom renaming panel by pressing the "Insert in List" button or by using the mouse (see the Custom Renaming Panel section for details).


Main Window PreDefined Commands Panel

Pre-Defined Command Panel

Pre-defined renaming commands are available for insertion into the custom list. There are many options available for configuring what these commands do (see the Option Window section for details ). When using pre-defined commands, different parts of the name to be replaced are selectable. The available parts to rename are the name prefix, the name extension, or the entire name. If a name has no extension, then choosing the prefix part or the entire name will have the same result. If a name has no extension, then choosing the extension part will result in no renaming.

Pre-defined renaming commands are available to:

  • Change selected part of filename to lower case.
  • Change selected part of filename to upper case.
  • Eliminate all extra whitespace from selected part of filename. This deletes leading and trailing whitespace and converts multiple whitespace sequences to single blank sequences.
  • Eliminate trailing whitespace from selected part of filename.
  • Eliminate leading whitespace from selected part of filename.
  • Change selected part of filename to title case. This results in the first letter of each word being capitalized with remaining letters of the word converted to lower case. Leading opening brackets (e.g. '(', '{', '[' ) in each word are skipped. This command also eliminates extra whitespace by deleting leading and trailing whitespace and converting multiple whitespace sequences to single blanks.
  • Change selected part of filename to sentence case. This results in the first letter of the first word being capitalized with remaining letters of the word converted to lower case. Leading opening brackets (e.g. '(', '{', '[' ) in each word are skipped. This command also eliminates extra whitespace by deleting leading and trailing whitespace and converting multiple whitespace sequences to single blanks.
  • Change selected part of filename so that upper case characters are swapped with lower case and vice-versa.
  • Insert an incrementing counter before or after the selected part of filename. Counter insertion options are configurable in the options window.
  • Insert email information before or after the selected part of filename. Email information insertion options are configurable in the options window.
  • Insert file properties information before or after the selected part of filename. File Properties insertion options are configurable in the options window.
  • Insert file office properties information before or after the selected part of filename. File Office Properties insertion options are configurable in the options window.
  • Insert HTML tag information before or after the selected part of filename. This will only apply to Markup Language type files like HTML or SGML. HTML Tag Insertion options are configurable in the options window.
  • Insert the parent folder before or after the selected part of filename. The parent folder is the name of the folder that the filename belongs to. The parent folder name does not include any other part of the base pathname for the file. For example if the full pathname of a file is "c:\My Documents\eBooks\Moby Dick", then the base pathname is '"c:\My Documents\eBooks', the filename is 'Moby Dick', and the parent folder name is 'eBooks'. Folder insertion options are configurable in the options window.
  • Insert music information before or after the selected part of filename. This only applies to audio files. Music Information Insertion options are configurable in the options window.
  • Insert image information before or after the selected part of filename. This will only apply to image files. The information is obtained from EXIF tags or basic image infromation of the files. Image Information Insertion options are configurable in the options window.
  • Insert image GPS information before or after the selected part of filename. This will only apply to image files. The information is obtained from EXIF tags. Image GPS Information Insertion options are configurable in the options window.
  • Insert image IPTC information before or after the selected part of filename. This will only apply to image files. The information is obtained from IPTC tags of the files. Image Information Insertion options are configurable in the options window.
  • Insert video information before or after the selected part of filename. This will only apply to video files. Video Information Insertion options are configurable in the options window.

The pre-defined renaming commands can be inserted into the custom renaming panel by pressing the "Insert in List" button or by using the mouse (see the Custom Renaming Panel section for details).

A separate scan can be run using the currently selected pre-defined renaming command. During the scan, names are first filtered using the Name Filter. The names passed by the filter are then scanned for potential replacements and a preview window is generated.


Main Window Specialized Renaming Panel

Specialized Renaming Panel

When scanning with specialized renaming, files are filtered based on the type of scan chosen. For example, an MP3 scan will result in scanning of all files that only have a '.mp3' extension (with any letter case). An Ogg scan will result in only '.ogg' files being scanned (with any letter case). The types of replacements found are based on the music command replacement options that are enabled.

Any of the specialized renaming commands can be inserted into the custom renaming panel by using the mouse (see the Custom Renaming Panel section for details). When specialized renaming commands are inserted into the custom renaming panel, then the configured Name Filter will be used instead of the specialized filter.


Main Window Status Bar

Status Bar

The Status bar indicates extra information about menu commands, the state of any scans in progress, and the result of the last scan.

  • Starting from the left, the first field shows extra information about a command available in the pull down menu but only when the mouse has selected the command.
  • During scans, the second field shows the total number names to be changed and the total number of scanned files.
  • During scanning, the third field shows which phase of the scan is occurring. When a scan is complete without errors, the total scan time will be displayed in the third field. The total time will vary depending on what else is occurring on the PC while the scan is in progress. If an error occurs during a scan then an error indicator will be displayed. An abort indicator will be displayed if a scan is aborted by the user.


Main Window Summary Panel

Summary Panel

Major events in the current folder are displayed on the summary panel. Each event is time-stamped.

  • Scan results are displayed in this panel. After a scan, the number of files to be changed and scanned are shown. The number of files to be changed does not include files that had errors. Files that had only warnings are included. The number of scanned files only includes the files scanned after file filtering.
    Additional information outlining the types of replacements made is displayed for music file scans.
    Error messages appear after a scan when there are naming conflicts, when there are illegal characters in the new name, or when the length of the pathname is greater than 256 characters. Warning messages appear after a scan when there are naming conflicts that have been automatically resolved.
  • The content of the search/replace rows are displayed. These can be copied to the clipboard and then inserted back into the custom list using the CTL-F2 shortcut key. This is useful for users to exchange their custom list info. All that has to be copied are the row/search/replace lines of the summary info. Any additional rows before or after the row/search/replace sequences are ignored. The sequences can also be copied and inserted the same way from the PFrank forum pages. The row part of the sequence is only used for validation. All the inserted rows are copied to the top of the custom list regardless of the row number specified.
  • The results of any renaming or undo commands are displayed in the panel.
  • The results of any renaming or undo batch file creation are displayed in this panel.

If you move the mouse between the bottom of the custom renaming panel and the top of the summary panel, you will find a sash which can be used to control the height of the summary panel.


Main Window User Command Panel

User Command Panel

The ultimate power-user renaming feature is available with the user defined commands. A command file is used to define your own commands. This is a feature intended for experienced programmers.

There are 2 main steps to configuring your own commands. The first is editing the command file, the second is verifying it.

Edit

After PFrank is first installed, pressing the 'Edit' button will result in the creation of a sample command file from a template. This command file can be used as a model. At the same time PFrank will attempt to open an editor so that you can edit the file. The file is located under the install folder as PFrankUser.py. Once it is created, any re-installs or upgrades from PFrank will leave it unchanged. The file is a python program file. If you already have an editor associated with python files, then that editor will automatically be invoked. If there is no associated editor, a warning message will be displayed. You will be given an option to continue with Notepad. The best thing to do in this case is to decline and configure a text editor to associate with python files. Any editor will work on the file but it is recommended to use a python aware editor like gvim or crimson. To associate an editor with the command file, to to the directory with the file (siaplyed in the summary panel), right click on the file and follow the 'open with..' menus to the editor program of your choice.

An alternative way to edit the file would be to use the editor that comes with installing a python interpreter on your PC. A python installation file can be obtained from here. After installing, then right clicking on any python file will provide an option to start IDLE. IDLE is a python development environment used to edit files, run them, and debug them.
An excellent tutorial for learning python can be found at: here

Sample command classes are available in the initial template file that is created and can be used as models for the commands that you really want. There are instructions within the file outlining the interface and the key parts that can and cannot be modified. You can make use of any python library by importing it. If it doesn't import properly from within PFrank then you will have to provide the library yourself. All you have to do is copy it into the PFrank folder and it will be found when PFrank runs.

Verify

The 'Verify' button is used to find all the command classes in the command file and verify their interfaces to ensure that they can be used for renaming. After verification, you will be prompted to load the commands into PFrank. Once done, the commands will appear at the end of the pre-defined command list and can be inserted into the custom list like any other command.


Option Window

The option window is used to configure all options. The options window is made available from the main window by accessing the menu bar. The window consists of 2 main areas. A tree structure in the left side of the window is used to provide quick access to any of the option panels. When an option is selected from the tree, the corresponding option panel appears on the right side of the window.
The options are grouped into the following categories:

  • General Options
  • Music Options
  • Picture Options

The APPLY, OK, and CANCEL buttons at the bottom of the window are shared by all the option panels. When a user presses any of these buttons, updates from all panels will be applied (or cancelled).


General Options

The General Options are one of the groups of options available under the options window. They apply to all renaming unless specified otherwise. The General Options are: subdivided further into the following categories:

  • General Renaming Options
  • Pre-Defined Renaming Options
  • Custom Renaming Options

General Renaming Options

The available General Renaming Options are:

  • Name Filters
  • General Display
  • Column Display
  • Date Formatter
  • Favourite Folders List
  • Favourite Filters List (Python)
  • Favourite Filters List (Unix)
  • Miscellaneous

Pre-Defined Renaming Options

The available Pre-Defined Renaming Options are:

  • Change Case
  • Counter Insertion Parameters
  • Hash Insertion Parameters
  • HTML Tag Insertion Parameters
  • Properties Insertion Parameters
  • Parent Folder Name Insertion Parameters

Custom Renaming Options

The available Custom Renaming Options are:


General Options Change Case

Change Case Parameters

This is used to select options for the pre-defined renaming 'Change Case' commands.
Options are available to enable the use of the 'Force Case' tables (defined in the General renaming options) for use with the various Change Case commands. The tables contain lists of words. These words, if found in a name, will retain the case specified in the table after a renaming command. One table is available for all words. Another table is available for words in the middle of a name. The 'middle words' table overrides the 'all words' table.
e.g. if the word 'UB40' is in the 'all words' table and the 'title case' renaming command is applied to: 'i love ub40', the resulting name will be 'I Love UB40'

Words can be imported from a file or they can be entered into the text panel. located above the list. Multiple words are split up into individual words and then inserted into the list.

Force Case (All Words)

A configurable list for determining which words must remain in a specified case (acts on all words in a filename). For example, if the word 'ACDC' is in the list, and the word 'acdc' (or other case variations like 'ACdc', or 'AcDc' for example) appears as a word anywhere in a filename, then 'acdc' (or other case variations) will be replaced with 'ACDC'.

Force Case (Middle Words)

A configurable list for determining which words must remain in a specified case ( acts only on words if they are found in the middle of a filename). The middle of a filename is defined as words that do not appear in the beginning of a field. Examples are shown in the Music 'Force Case List Options' section.


General Options Column Display

Column Display

The display of columns in the Preview List of the Detailed Information window can be controlled manually or automatically. All columns are organized into groups. The enabling of columns can be done one at a time or on a group basis.

Automatically Enabled Columns Mode

In this mode, the display of columns are automatically enabled based on selected criteria. For all selections, there are some basic columns that are always enabled. e.g. old name, new name, old length, new length, name type.

By Meta-Data Insert

Column groups are enabled based on what type of meta data you are trying to insert. e.g. If you are inserting music meta data then the columns of the music and music tag groups will be enabled.

By Extension

Column groups are enabled based on the extension of files that are being renamed. e.g. If you are renaming mp3 files then the columns of the music and music tag groups will be enabled.

Manual Column Configuration Mode

Column attributes can be manually configured if 'automatically enabled column' mode is disabled. Individual or groups of columns can be enabled/disabled. The columns can also be arranged in any order. One thing to keep in mind is that the fewer columns that are displayed the faster the refresh/scrolling is of the preview panel. i.e. displaying 120 columns will be slower than displaying 20 columns.

Name Properties Group

These are columns used to display properties related to the file/folder name. e.g. name length, pathname.

Auto Enabled Columns Group

These are columns that are always automatically enabled when required. Disabling/Enabling of these types of columns is not user configurable.

Always Enabled Columns Group

These are columns that are always enabled. Disabling/Enabling of these columns is not user configurable.

File Properties Columns Group

These are columns that apply to all names.

Music Columns Group

These are columns used to display music meta-data for music (or audio) files.

Music Tag Columns Group

These are columns used to display music tag meta-data for music (or audio) files.

Other Columns

Other column groups are available for displaying email, image, html, office properties, video, and hash meta-data.

Column Widths

Column Widths are automatically saved when modifying them on the Detailed Information Window. A button is available in this option panel for resetting the widths to their default. This option is available during manual or automatic column control modes.


General Options Counter Insertion

Counter Insertion

This is used to select options for the pre-defined renaming 'Counter Insertion' commands. Counters can be configured for incrementing mode or random mode.

In Incrementing mode, the start value, the increment, and whether to restart the counter with each subfolder are configurable. The start value and the increment can be negative.

In random mode, positive random numbers are generated based on a seed. If you use the same seed, then the same random numbers will be generated. If you specify a seed of -1, then a seed based on the time of day will be chosen for you.

The user can choose the minimum number of digits that will be displayed for the number. Leading zeros are added to the number display when necessary.

The user can choose the maximum number of digits that will be displayed for the number. Numbers with too many digits will have their high order digits removed so as not to exceed the maximum. If a number is negative then the negative sign is counted in the digit count. The negative sign is never removed. To configure the maximum number of digits, the user actually enters a value which is added to the configured 'Minimum nNumber of Digits'. For example, if the minimum number of digits is 3 and the configured value for the maximum number of digits to add is 2, then the maximum number of digits will be calculated to be 3 + 2 = 5.

The user can choose which number base the numbers are displayed in. Any base from 2 to 36 can be chosen. Base 10 is the same as decimal, Base 16 is the same as hexadecimal, Base 8 is the same as octal, and Base 2 is the same as Binary.

There is a button available which can be used to reset all counter options to their default values.

A preview field shows example sequences of numbers based on the configured options.


General Options Date Formatter

Date Formatter

This is used to select how to format the date used for various insertion commands. For example, the image insertoin and file properties insertion commands allow the insertion of dates. The options are either pre-defined formats such as DDMMYYY or custom formats which the user can build themselves.

For the custom format, a fully customizable format tool is used to insert date/time codes into the custom text panel. The codes correspond to different date/time parameters. Any other valid characters can also be specified with the codes. A text panel will show an example of what the formatted output will look like. The codes will be highlighted with the colour red.


General Options Email Information Insertion

Email Information Insertion

This is used to select options for 'Email Information Insertion' commands.

To configure the insertion, a fully customizable format tool is used to insert Email information codes into a text field. The codes correspond to different Email fields. Any other valid characters can also be specified with the codes. A preview field will show an example of what the formatted output will look like. The codes will be highlighted with the colour red.

In order to prevent illegal characters from being inserted, all ':' characters are eliminated when inserting 'date' meta-data and all angle brackets are converted to square brackets when inserting 'to', 'from', or 'cc' meta-data.

There is a button available which can be used to reset all Email Information insertion options to their default values.

This insertion feature is incompatible with files generated by Microsoft Outlook.


General Options Favourite Filters List (Regex)

Favourite Filters List (Python)

This is used to select which expressions are available in the main window name filter pull-down list when the name filter is configured for Python Regular Expressions. You can organize them in any order you wish.

The Favourite filters are not used by the specialized renaming scans.


General Options Favourite Filters List (Wildcard)

Favourite Filters List (Unix)

This is used to select which wildcards are available in the main window name filter pull-down list when the name filter is configured for Unix Wildcards. You can organize them in any order you wish.

The Favourite filters are not used by the specialized renaming scans.


General Options Favourite Folders List

Favourite Folders List

This is used to select which folders are available in the main window current folder pull-down list. You can organize them in any order you wish.


General Options File Properties Insertion

File Properties Insertion

This is used to select options for the pre-defined renaming 'File Properties Insertion' commands.

To configure the insertion, a fully customizable format tool is used to insert file property codes into a text field. The codes correspond to different file parameters. Any other valid characters can also be specified with the codes. A preview field will show an example of what the formatted output will look like. The codes will be highlighted with the colour red.

A code is included for the current date/time (Yes I know this is not a file property but for now this is a convenient place to provide it!).

There is a button available which can be used to reset all file properties insertion options to their default values.


General Options General Display

General Display

This is used to configure general display options for the various windows.

Detailed Information Window

The Detailed Information section has an option for enabling/disabling the display of the thumbnail when a picture file is selected. Disabling the thumbnail will speed up the updating of this window if a picture file is selected. Colours of different parts of the window are configurable.

Colours for different types of rows (e.g. rows with warnings, errors, etc) can be changed.

By default, rows are sorted according to the order they were scanned. If you sort the rows by some column, that same column can be used as a basis for future sorting if you enable the 'Save Last Sorted' option.

You can configure whether you want to use regular sorting or numeric-based sorting (sometimes called natural sorting) for names that have a mixture of alphabetic characters and numbers. An example best illustrates the difference. The names A10, A2, A000100 are sorted by a regular sorter in ascending order to yield: A000100, A10, A2. The same entries sorted by numeric based sorting yields: A2, A10, A000100. The difference is that when numbers are present in names, their numerical values are taken into account in the sorting. You may have noticed that Windows XP uses numeric based sorting to sort filenames. Older Windows operating systems like Windows 2000, ME, etc. use regular sorting (i.e. character based sorting).
If names are sorted that only have numbers in them or if you are sorting by a column that only has numbers in it (e.g. old name length), then those names will always be sorted in numeric order.

By default, when the preview list is made, names that have not changed are not listed. There is an option that will allow the display of unchanged filenames. This can be useful if you want to modify file properties (see Detailed Information Preview List popup menu options) for all files rather than just the ones that are being renamed.

The preview list has an icon column down the left-hand side. The display of this column can be disabled by unchecking the 'show icon column checkbox'

The font size of the preview list characters can be modified. Changing the font size will affect the width of the rows. If the font size is made smaller than the default, then you should also disable the display of the icon column otherwise the column width of the rows will be set to match the icon size instead of the character size.

Option Window

The Option Window section has an option for choosing the background colour of the window.

Main Window

The Main Window section has an option for choosing the background colour of the window.

Common Features

When selecting a colour, a colour palette window will appear. In it you can also specify custom colours. When saving a selection in this window, all the custom colours will also be saved.

All window sizes are saved automatically when the program exits. There is therefore a button to reset the window sizes to their default sizes.

There is a button to reset all display options to their default values. When this is pressed, all custom colours in the colour palette will also be reset to their default values. This button will not, however, reset the window sizes.


General Options Hash Insertion

Hash Insertion

This is used to select options for 'Hash Information Insertion' commands.

To configure the insertion, a fully customizable format tool is used to insert html tag codes into a text field. The codes correspond to different Hash values. Any other valid characters can also be specified with the codes. A preview field will show an example of what the formatted output will look like. The codes will be highlighted with the colour red.

There is a button available which can be used to reset all Hash information insertion options to their default values.

Hash values involve reading every byte of a file so please be aware that calculating values for insertion could take a very long time for large files.


General Options HTML Tag Insertion

HTML Tag Insertion

This is used to select options for 'HTML Tag Information Insertion' commands.

To configure the insertion, a fully customizable format tool is used to insert html tag codes into a text field. The codes correspond to different HTML tags. Any other valid characters can also be specified with the codes. A preview field will show an example of what the formatted output will look like. The codes will be highlighted with the colour red.

There is a button available which can be used to reset all HTML tag insertion options to their default values.


General Options Miscellaneous

<

Miscellaneous (Duplication Handling, SVN)

The following options are available in this panel.
  • Enabling/disabling the automatic resolution of any renaming that would produce filename duplications (i.e. collisions). When enabled, filename collisions are automatically resolved by appending a uniquely numbered string to the new name. You can specify whether to use the same number formatting as for inserting counters. If you don't choose the number formatting, then a default number format plus a 'PF.' string will be used. Other options include being able to restart the numbering with each duplicate file group and choosing where to place the string that will make duplicate filenames unique.

  • Enabling/disabling SubVersion(SVN) mode. This mode is not available lin Windows ME/98/95 systems. The feature is also only available in a special build. This build can be requested from the PFrank author. Contact information for the author is here.
    When enabled, all files to be renamed must be controlled by the SubVersion version control system. Errors will be flagged for files that are not controlled by SVN. Renaming the files will automatically update the Subversion repository used to track versions of the file. The following sub-options are available once SVN mode is enabled:
    • Auto-Commit after renaming. By default, files are automatically commited to the SVN repository after renaming. This feature can be disabled if desired. For example, if you rename the source code files for a program and want hold off on the commits until you verify that everything still compiles after renaming, then you would probably want to disable auto commit's. Once satisfied with the new names, you can use the SVN Commit button on the Detailed Information Window to commit all the files. Note that Auto-Commit cannot be disabled with recursive folder renaming enabled.
    • Forced renaming. By default, files are renamed even if the files have uncommitted changes. If this option is disabled, then files with uncommitted changes will not be renamed.

  • Choosing Unicode Codec. This feature is for expert users who are renaming files/folders which use character sets not supported by the default character codec. You can configure which codec to use for decoding files used in the 'Import Rename List' feature. For import codecs:
    • You can choose a default codec which would result in PFrank using the codec corresponding to your current code page.
    • You can also choose an auto-detector which will try to determine which codec to use based on the file content. IF the auto-detection fails, then the decoding will be attempted with the default codec.
    • You can choose a codec from an extensive list.

    You can also separately configure which codec to use for encoding the summary file, exported csv, or exported batch renaming/undo files. For export codecs:

    • You can choose a default codec which would result in PFrank using the codec corresponding to your current code page.
    • You can choose a codec from an extensive list.


General Options Name Filters

Name Filters

The Name Filter options are used to filter names before applying any renaming criteria to them. For example if you have a folder containing mp3 and jpeg files, you can use a filter so that only mp3 file names are examined during renaming scans. Some configurable options for the filters are on the option window and the remainder are in the Main Window Name Filter Panel.
  • Choosing whether name filter pattern expression types are "unix wildcard" or "python regular expressions". Names matched by the pattern will be accepted for renaming.
  • Choosing the minimum length that a name has to be in order to be renamed. Names that are shorter than the minimum will not be accepted by the scanner for renaming.
  • Choosing the maximum length that a name has to be in order to be renamed. Names that are longer than the maximum will not be accepted by the scanner for renaming.
  • Choosing the minimum length that a pathname has to be in order to be renamed. The pathname includes the name of the file/folder. Pathnames that are shorter than the minimum will not be accepted by the scanner for renaming.
  • Choosing the maximum length that a pathname has to be in order to be renamed. The pathname includes the name of the file/folder. Pathnames that are longer than the maximum will not be accepted by the scanner for renaming.
  • Choosing names to exclude based on a filter pattern. A python regex pattern or unix wildcard pattern (depending on the name filter pattern expression type) is used to define the filter pattern.
  • Enabling/disabling the scanning of the contents of subfolders. A number of options specific to subfolder filtering are available.

    If subfolder scanning is enabled, you can use a filter pattern to specify subfolders which are to be excluded from renaming. A python regex pattern or unix wildcard pattern (depending on the name filter pattern expression type)is used to define the filter pattern. Any subfolder that matches the filter pattern will be excluded from renaming; the contents of excluded folders are also excluded. The exclusion filter is specified in Python Regular expression notation. e.g. ^[.] will filter folders that start with a . or (abc$|.xyz$) will filter folders that end in abc or xyz. If you leave the filter value blank, no subfolders will be skipped. The current folder is never skipped. The Enter key must be pressed to finalize the entry.

    If subfolder scanning is enabled, you can specify the number of levels that the scanner will search for names.


General Options Office Properties Insertion

Office Properties Insertion

This is used to select options for the pre-defined renaming 'Office Properties Insertion' commands. Office properties that are only available for Microsoft Office type documents (e.g. Excel, Word, Powerpoint, etc.) The properties are normally viewable from explorer by right-clicking on a file, choose Properties, and then choose the 'Summary' tab.

To configure the insertion, a fully customizable format tool is used to insert office property parameters into a text field. The codes correspond to different office properties. Any other valid characters can also be specified with the codes. A preview field will show an example of what the formatted output will look like. The output is based on a sample file that has most of the meta data in it. The codes will be highlighted with the colour red.

There is a button available which can be used to reset all office properties insertion options to their default values.


General Options Folder Insertion

Parent Folder Name Insertion

This is used to select options for 'Parent Folder Name Insertion' commands. Parent folder names going back up to 9 levels may be selected.

To configure the insertion, a fully customizable format tool is used to insert folder codes into a text field. The codes correspond to different folder levels. Any other valid characters can also be specified with the codes. A preview field will show an example of what the formatted output will look like. The codes will be highlighted with the colour red.


Music Options

The music options are one of the groups of options available under the options window. They can be used to ensure that all your music files have consistent formatting. The music options are split into the following categories:

Specialized Renaming Options

  • Replacement Commands - A set of replacement commands which can be enabled/disabled. The replacement commands are highly customized and are explained in the Music Replacement Commands section.
  • Force Case (Middle Words) - Music - A configurable list for determining which words must remain in a specified case ( acts only on words if they are NOT found at the beginning or end of a filename). For example, if the word 'the' is in the list, and the word 'THE' (or other case variations like 'The', or 'tHe' for example) appears as a word in the middle of a filename, then 'THE' (or other case variations) will be replaced with 'the'
  • Force Case (All Words) Music - A configurable list for determining which words must remain in a specified case (acts on all words in a filename). For example, if the word 'ACDC' is in the list, and the word 'acdc' (or other case variations like 'ACdc', or 'AcDc' for example) appears as a word anywhere in the filename, then 'acdc' (or other case variations) will be replaced with 'ACDC'.

If the same word appears in both the Force Case (Middle Words) list and the Force Case (All Words) list, then the Force Case (MIddle Words) list takes precedence.

After executing a music scan, the resulting replacements available should satisfy most users. If some replacements are undesirable, either modify a suitable replacement command or a list parameter or, instead, make the changes using the custom search/replace.

Pre-Defined Command Options

Music Information Insertion

Information from music file tags or from the music file format can be inserted in the filename. Supported tags include MP3 (ID3v1 or ID3v2), Ogg Vorbis, or Flac. Available information includes Artist, Title, Album, Genre, Year, Track, Bit Rate, Bit Rate Type (MP3 Only), and Length (or Play Time). The Bit Rate is shown in 'Kbps'. A fully customizable formatter allows you to specify tag codes to insert. The codes correspond to different information frames available in the tag header. If the frame information corresponding to the code is found in the header without any errors, then the information will be inserted. Otherwise, the tag code will be replaced according to a configurable option that lets you either replace the missing information with a null string or a default string. The default string is the code used in the custom formatter. e.g. %Artist% is inserted if the artist information is missing. A problem declaration could also be produced according to a configurable option that sets the scanner to declare an error, warning, or do nothing if a tag to be inserted is missing.

If any unprintable characters or invalid filename characters such as ':', '?', '<', '>', '*', '/', or '\' are in the tag information, then an illegal character error will be produced.

Any other valid characters can also be specified with the codes. A text panel will show an example of what the formatted output will look like. The output is based on a sample file that has most of the meta data in it. The codes will be highlighted with the colour red.

The Grouping feature is a configurable option for music information insertion.

The processing time for tag-based information insertion is slow compared to the other pre-defined renaming commands because the files have to be opened, searched for the tag information, and the tags interpreted. However, the processing time when specifying any of the BitRate, Length, or Bit Rate Type codes, can be much larger than that for any of the other codes since these types of information are contained in the frames of the file and not the header.


Music - Replacement Commands

  • Introduction
  • Use Forward Quote Instead of Backquote
  • Use ' - ' for Field Delimiter
  • Use 'No.<number>' for Numbers; e.g. No.5
  • Use 'Op.<number>' for Opus's; e.g. Op.6
  • Use Extension indicated by scan - e.g. .mp3, .ogg
  • Use Parentheses '()' for Bracketing
  • Eliminate Multiple/Extra Blank Sequences
  • Use Smart Title Case
  • Force Case of Words Listed in 'Force Case List Options'

Introduction

The music options can be used to make all your music files have consistent formatting. The user can select which replacement commands are enabled during a music scan. Ideally all options should be enabled at the same time. This is because some of the options result in side-effects which would be cleaned up by other options. All options are listed in the sections below. Any side-effects are explained. Each section has a table with example replacements. Unless specified otherwise, the examples are all assuming mp3 scans. For other types of scans, just replace the '.mp3' extensions with the applicable extension (e.g. '.ogg' or '.flac')

Use Forward Quote Instead of Backquote

Replaces the backquote character ("`") with the forward quote character ("'").

Side Effects: None.

Examples:

String before Replacement | String after Replacements
`abc`.mp3 | 'abc'.mp3
``abc``.mp3 | ''abc''.mp3
`ab`c`.mp3 | 'ab'c'.mp3

Use ' - ' for Field Delimiter

Replaces '~', '_', or '=' characters with '-' characters. If there are consecutive delimiter characters, they will be replaced with a single delimiter. If there are missing blanks around a delimiter, then the character sequence will be modified so that there is at least a single blank on each side of the delimiter. If it is found that there are numbers with at least 2 digits on both sides of a dash, then it is assumed that the dash is not a field delimiter but is some kind of date range. In such a case any spaces around the dash will be removed.

Side Effects: It's possible for the string to end up with extra blanks. Enable the 'Eliminate Multiple/Extra Blank Sequences' option to compensate.

Examples:

String before Replacement | String after Replacements
abc -- abc.mp3 | abc - abc.mp3
abc = abc_abc ~ abc.mp3 | abc - abc - abc - abc.mp3
abc==abc__abc~~~abc == abc.mp3 | abc - abc - abc - abc.mp3

Use 'No.<number>' for Numbers; e.g. No.5

Number prefixes are often used in names of classical music files. This option is used to replace number prefixes plus numbers with 'No.<number>'. Number prefixes include 'no' (and all letter case variations) and 'nr' (and all letter case variations) followed by an optional period.

If the words Concerto, Sonata, Sonate, Symphonie, Symphony (and all their letter case variations) appear before a number sign, then:

  1. 'Sonate' (and all it's letter case variations) will be replaced with 'Sonata', and 'Symphonie' (and all it's letter case variations) will be replaced with 'Symphony'
  2. #<number> will be replaced with 'No.<number>'
Side Effects: In some cases multiple blank sequences within the number string will be reduced to single or no blanks.

Examples:

String before Replacement | String after Replacements
Beethoven - Romance Nr5.mp3 | Beethoven - Romance No.5.mp3
Beethoven - Symphony No5.mp3 | Beethoven - Symphony No.5.mp3
Beethoven - Symphony NR5.mp3 | Beethoven - Symphony No.5.mp3
Beethoven - Symphony no.5.mp3 | Beethoven - Symphony No.5.mp3
Beethoven - Symphony no .5.mp3 | Beethoven - Symphony No.5.mp3
Beethoven - Symphony nR5.mp3 | Beethoven - Symphony No.5.mp3
Beethoven - Symphony #5.mp3 | Beethoven - Symphony No.5.mp3
Beethoven - Symphonie #5.mp3 | Beethoven - Symphony No.5.mp3
Beethoven - Sonata #5.mp3 | Beethoven - Sonata No.5.mp3
Beethoven - Concerto # 5.mp3 | Beethoven - Concerto No.5.mp3
Beethoven - Concerto 5.mp3 | Beethoven - Concerto No.5.mp3
Beethoven - Concerto5.mp3 | Beethoven - Concerto No.5.mp3

Use 'Op.<number>' for Opus's; e.g. Op.6

Opus prefixes are often used in names of classical music files. This option is used to replace opus prefixes plus numbers with 'Op.<number>'. Opus prefixes include 'op' (and all letter case variations) and 'opus' (and all letter case variations).

Side Effects: In some cases multiple blank sequences within the opus string will be reduced to single or no blanks.

Examples:

String before Replacement | String after Replacements
Beethoven - Romance No.2 in F Opus50.mp3 | Beethoven - Romance No.2 in F Op.50.mp3
Beethoven - String Quartet No.12 in E - Flat Major, OP.127.mp3 | Beethoven - String Quartet No.12 in E - Flat Major, Op.127.mp3
Beethoven - String Quartet No.12 in E - Flat Major, op127.mp3 | Beethoven - String Quartet No.12 in E - Flat Major, Op.127.mp3
Beethoven - String Quartet No.12 in E - Flat Major, OPUS.127.mp3 | Beethoven - String Quartet No.12 in E - Flat Major, Op.127.mp3
Beethoven - String Quartet No.12 in E - Flat Major, oP127.mp3 | Beethoven - String Quartet No.12 in E - Flat Major, Op.127.mp3

Use Extension Indicated by Scan - e.g. .mp3, .ogg, .wav

Change different extension variations to the extension indicated by the scan. For example, if an mp3 scan is performed, then all mp3 extension variations will be changed to '.mp3' Extension variations include double extensions, up to 2 digit numbers in parentheses before the extension, extensions that are not all lower case, extensions prefixed by kbps indicators in parentheses, and extensions prefixed by commas or up to 2 periods.

Side Effects: In some cases multiple blank sequences will be reduced to single or no blanks.

Examples:

String before Replacement | String after Replacements
Aerosmith - Dream On.MP3 | Aerosmith - Dream On.mp3
Aerosmith - Dream On.Mp3 | Aerosmith - Dream On.mp3
Aerosmith - Dream On.mp3.MP3 | Aerosmith - Dream On.mp3
Aerosmith - Dream On - .MP3 | Aerosmith - Dream On.mp3
Aerosmith - Dream On , .MP3 | Aerosmith - Dream On.mp3
Aerosmith - Dream On(1).MP3 | Aerosmith - Dream On.mp3
Aerosmith - Dream On(1) .MP3 | Aerosmith - Dream On.mp3
Aerosmith - Dream On..MP3 | Aerosmith - Dream On.mp3
Aerosmith - Dream On(192 kbps).MP3 | Aerosmith - Dream On.mp3
Aerosmith - Dream On(192k).MP3 | Aerosmith - Dream On.mp3
Aerosmith - Dream On(192 ks) .MP3 | Aerosmith - Dream On.mp3

Use Parentheses '()' for Bracketing

Change all bracketing to parentheses. Bracketing that is changed includes '{'. '}', '[', and ']'.

Side Effects:
  1. If this fix results in a parenthesized number before the file extension, then the number will not be removed even if the 'Use extension indicated by scan' option is enabled. eg. [1].mp3 becomes (1).mp3, and the (1) sequence will not be removed. If this is not desirable then just perform the replacements and rescan with 'Use extension indicated by scan' option enabled.
  2. multiple brackets are collapsed to one. This does not happen with multiple parentheses.

Examples:

String before Replacement | String after Replacements
Burton Cummings - Clap For the Wolfman [Live].mp3 | Burton Cummings - Clap For the Wolfman (Live).mp3
Burton Cummings - Clap For the Wolfman {Live}.mp3 | Burton Cummings - Clap For the Wolfman (Live).mp3
Burton Cummings - Clap For the Wolfman [{Live}].mp3 | Burton Cummings - Clap For the Wolfman (Live).mp3
Burton Cummings - Clap For the Wolfman {[Live}.mp3 | Burton Cummings - Clap For the Wolfman (Live).mp3

Eliminate Multiple/Extra Blank Sequences

Change multiple blank sequences to one blank. Blanks after an opening parentheses, before a closing parentheses, or before the filename extension are eliminated.

Side Effects: If a single dash appears before the filename extension, it will be eliminated.

Examples:

String before Replacement | String after Replacements
Burton Cummings - Clap For the Wolfman (Live) .mp3 | Burton Cummings - Clap For the Wolfman (Live).mp3
Burton Cummings - Clap For the Wolfman ( Live ).mp3 | Burton Cummings - Clap For the Wolfman (Live).mp3
Burton Cummings - Clap For the Wolfman (Live) .mp3 | Burton Cummings - Clap For the Wolfman (Live).mp3
Burton Cummings - Clap For the Wolfman (Live) - .mp3 | Burton Cummings - Clap For the Wolfman (Live).mp3

Use Smart Title Case

The following algorithm is performed in sequence.
  1. Determine if filename string is all upper case or just has a few uppercase words. If it is detected that a) there are at least 2 consecutive words (one at least 3 letters long, the other at least 2 letters long) that are all upper case or b) there are 3 or more uppercase letters at the start of the name followed by a delimiter then it is assumed that the string is mostly or all uppercase and will therefore be converted to all- lower case.
    If the string is determined to not be all upper case by the above algorithm, then it is assumed that there are probably just a few uppercase abbreviations or words with uppercase letters that should be left alone. Therefore the all-lower case conversion is not performed and the sequence ends. Otherwise the sequence continues.
  2. The first letter of each word will be set to upper case (leading opening brackets (eg. '(', '[', '{' ) of each word are skipped).
  3. All leading and trailing whitespace characters will be eliminated.
  4. All remaining consecutive whitespace characters will be reduced to one blank.
The algorithm isn't perfect but should handle most case correction cases properly. Anything missed can be cleaned up using the pre-defined or custom replacement commands or using the 'Force Case' lists.

Side Effects: None

Examples:

String before Replacement | String after Replacements
abc - abd.mp3 | Abc - Abc.mp3
abc in the def.mp3 | Abc - In The Def.mp3
ABC On (featuring xx) .mp3 | Abc On (Featuring Xx).mp3
abc on the stage ALBW (featuring xx).mp3 | Abc On The Stage ALBW (Featuring Xx).mp3
ABBA - SOS (live).mp3 | ABBA - SOS (Live).mp3
ABC On THE stage.mp3 | Abc On THE Stage.mp3
ABC (on THE stage).mp3 | ABC (On THE Stage).mp3

Force Case of Words Listed in 'Force Case List Options'

There are some words that users would like to appear in a specific letter case sequence. For example the names ACDC, REM, or LSO might appear with different letter cases in filenames. After all other replacements are performed using the different music options, scans are made for specific words to ensure that they are in the correct letter case. The words are defined in the lists that are configured in the music 'Force Case List' options The lists to choose from are as follows:
  1. Force Case List (All)

    This list contains words that will be replaced if they don't appear in the correct letter case AND they are preceeded AND followed by a period, opening parentheses, comma, blank, or backquote. The words will also be replaced if they don't appear in the correct letter case AND they are at the start of the filename AND are followed by a period, opening parentheses, comma, blank, or backquote.
  2. Force Case List (middle)

    This list contains words that will be replaced if they don't appear in the correct letter case AND they are preceeded AND followed by a blank. The words will not be replaced if the preceeding blank is preceeded by a dash delimiter or an '&' This list can be used to keep words such as 'a', 'and', 'in', 'at', 'is', 'of', 'or', 'on', 'to', or 'the'
Side Effects: If words in a list appear more than once in a sequence, then the first word will be replaced but the second one will be ignored, the third replaced, the fourth ignored, etc.

For the following examples, assume the words 'SOS' and 'REM' are in the Force List (All) list and the words 'in' and 'the' are in the Force List (middle) list.

Examples:

String before Replacement | String after Replacements
Abba - sos.mp3 | Abba - SOS.mp3
Abba - sos sos.mp3 | Abba - SOS sos.mp3
Artist - Stuck - In THe Middle.mp3 | Artist - Stuck - In the Middle.mp3
rem & The Band - The Remarkable Harem.mp3 | REM & The Band - The Remarkable Harem.mp3
ABC - What is On THE Stage.mp3 | ABC - What is on the Stage.mp3


Picture Options

Pre-Defined Renaming Options

Image Information Insertion

Information from EXIF tags of jpeg or tiff files can be inserted in the filename. Information supported includes the data/time a picture was taken, the image width, the image height, camera make, camera model, and various other attributes. Width and Height information from gif, png, bmp, or psd files can also be inserted in the filename.

A fully customizable formatter allows you to specify tag codes to insert. The codes correspond to different information frames available in the EXIF header. If the frame corresponding to the code is found in the EXIF header without any errors, then the information will be inserted. If no image information is available, then the tag code will be replaced according to a configurable option that lets you either replace the missing information with a null string or a default string. The default string is the code used in the custom formatter. e.g. %DateTime% is inserted if the date/time information is missing. A problem declaration can also be produced according to a configurable option that sets the scanner to declare an error, warning, or do nothing if a tag to be inserted is missing.

If any unprintable characters or invalid filename characters such as ':', '?', "<", ">", '*', '/', or '\' are in the tag information, then an illegal character warning will be produced.

Any other valid characters can also be specified with the codes to be used as a separator.

The Grouping feature is a configurable option for image information insertion.

A text panel will show an example of what the formatted output will look like. The output is based on a sample file that has most of the meta data in it. The codes will be highlighted with the colour red.

If the date/time info is found, it will be formatted as specified in the 'Date Formatter" options.

GPS Information Insertion

GPS information from jpeg, or tiff files can be inserted in the filename. A fully customizable formatter allows you to specify information codes to insert. The codes correspond to different GPS information available in the file header. If the information corresponding to the code is found in the file without any errors, then the information will be inserted. If no GPS information is available, then the code will be replaced according to a configurable option that lets you either replace the missing information with a null string or a default string. The default string is the code used in the custom formatter. e.g. %Latitude% is inserted if the latitude information is missing. A problem declaration could also be produced according to a configurable option that sets the scanner to declare an error, warning, or do nothing if a tag to be inserted is missing.

If any unprintable characters or invalid filename characters such as ':', '?', "<", ">", '*', '/', or '\' are in the gps information, then an illegal character warning will be produced.

Any other valid characters can also be specified with the codes. A text panel will show an example of what the formatted output will look like. The output is based on a sample file that has most of the meta data in it. The codes will be highlighted with the colour red.

The Grouping feature is a configurable option for GPS information insertion.

IPTC Information Insertion

IPTC information from jpeg, tiff, or psd files can be inserted in the filename. A fully customizable formatter allows you to specify information codes to insert. The codes correspond to different IPTC information available in the file header. If the information corresponding to the code is found in the file without any errors, then the information will be inserted. If no IPTC information is available, then the code will be replaced according to a configurable option that lets you either replace the missing information with a null string or a default string. The default string is the code used in the custom formatter. e.g. %ByLine% is inserted if the by-line information is missing. A problem declaration could also be produced according to a configurable option that sets the scanner to declare an error, warning, or do nothing if a tag to be inserted is missing.

If any unprintable characters or invalid filename characters such as ':', '?', "<", ">", '*', '/', or '\' are in the iptc information, then an illegal character warning will be produced.

Any other valid characters can also be specified with the codes. A text panel will show an example of what the formatted output will look like. The output is based on a sample file that has most of the meta data in it. The codes will be highlighted with the colour red.

The Grouping feature is a configurable option for IPTC information insertion.

Video Information Insertion

Video information from avi, mpeg, or various other video files can be inserted in the filename. Information supported includes the video length, codec, width, height, and frames per second. A fully customizable formatter allows you to specify information codes to insert. The codes correspond to different video information available in the file header. If the information corresponding to the code is found in the file without any errors, then the information will be inserted. If no video information is available, then the code will be replaced according to a configurable option that lets you either replace the missing information with a null string or a default string. The default string is the code used in the custom formatter. e.g. %Codec% is inserted if the codec information is missing. A problem declaration could also be produced according to a configurable option that sets the scanner to declare an error, warning, or do nothing if a tag to be inserted is missing.

If any unprintable characters or invalid filename characters such as ':', '?', "<", ">", '*', '/', or '\' are in the video information, then an illegal character warning will be produced.

Any other valid characters can also be specified with the codes. A text panel will show an example of what the formatted output will look like. The output is based on a sample file that has most of the meta data in it. The codes will be highlighted with the colour red.

The Grouping feature is a configurable option for video information insertion.


Detailed Info Window

Detailed Information Window

  • Preview List
  • Menu Bar
  • Display Mode Panel
  • Modify List Panel
  • Thumbnail Panel
  • SVN Panel
  • Renaming Actions Panel
  • Status Bar

The Detailed Information Window is used to review the list of files (produced by a scanner) which are to be renamed. Information regarding any errors or warnings are included. Users are expected to view the results in this window, make modifications if desired, redo the scan if desired, and once satisfied with the renaming specified, can then access the rename command to carry out the renaming. This window is automatically made available after a scan.


Detailed Info Window Display Mode Panel

Display Mode Panel

The display formats can be configured from the button panel at the bottom of the screen. The available formats are:

  • Sortable - Displays all the available columns. The detected problems column is not shown if there are no problems. All columns are sortable in either descending or ascending order. All columns except 'Old Name' and 'New Name' can be configured to be hidden or shown. Note that the sorting of MP3 tag or Picture Information Columns could be slow if the files are large. If you find the sorting is taking too long you can abort using the CTL-ALT-0.
  • Vertical Compare - Gives a different perspective by displaying the current name with the new name directly below it so that it is easy to compare the names. The length of the old and new names, the full pathname length of the old and new names, the name type, the pathname, and the detected problems are shown. The detected problems column is not shown if there are no problems. None of the columns are sortable. Most of the columns can be configured to be hidden or shown.


Detailed Info Window Menu Bar

Menu Bar

From the Deatiled Information menu bar, users can create the renaming batch file, create the undo batch file, execute the find command, or change views to the option or main windows.

Create Renaming Batch File Command

This command is used to create a batch file filled with renaming commands corresponding to the currently displayed list. The results of the file creation will be shown in the detailed information window Status Bar and the main window Summary Panel. A confirmation dialog will also appear to confirm the result of the creation. If you used the regex 'BUILD PATH' flag to rename files, then the batch file will not work for this renaming. The reason is that the Windows command line interface does not support recursive folder creation.

Create Undo Batch File Command

This command is used to create a batch file filled with renaming commands to undo the results of the previous renaming. The results of the file creation will be shown in the detailed information window Status Bar and the main window Summary Panel. A confirmation dialog will also appear to confirm the result of the creation. If you used the regex 'BUILD PATH' flag to rename files, then the batch file will not work for this renaming. The reason is that the Windows command line interface does not support recursive folder creation.

Export List to a CSV File

This command is used to create a Comman Separated Value file containing the information in the preview list. The results of the file creation will be shown in the detailed information window Status Bar and the main window Summary Panel. A confirmation dialog will also appear to confirm the result of the creation.

Find Command

This command is used to search for text in the detailed information panel. When the selected text is found, the row containing the text is highlighted. The results of the find will be shown in the detailed information window Status Bar. Among other things, this command makes it convenient to search for errors or warnings in large lists.

View Main Window Command

This command is used to raise the Main Window.

View Option Window Command

This command is used to raise the Option Window.

Detailed Info Row Commands Command

This command is used to display the same popup menu that is displayed when right clicking on the list. Commands available in the popup menu are:

  • Cancel Edit in Selected Rows. Using this option will cancel any manual edits that were done in the selected rows.
  • Delete Selected Rows. Using this option will delete all selected rows.
  • Various Positioning Options. Options are available for moving selected rows up, down, to the top of the list, or to the bottom of the list. There is also an option to randomly organize the rows..
  • Open 'Old Name' in Selected Row using Default Application. Using this option will open the selected file.
  • Set All Column Widths to Default. Using this option will reset the column widths to their default widths.
  • Show Hex Codes for 'Old and New Names' of Selected Row. Using this option will display the hex values of all characters for the old and new names.
  • Update Comment Field in Tag of Selected Rows. Using this option will allow you to add/replace the comment of a file if it has a tag with a comment field. This only applies to EXIF and MP3 tags. More information is available in the dialog box that appears when you select this option.


Detailed Info Window Modify List

Modify List Panel

  • Redo Last Scan Button. You can redo the last scan to the names in the preview list. The rescanning is applied to the old names. This can be done after the names have been sorted, moved, deleted, or randomized. This can also be done after changing the renaming options. The only renaming options that are ignored by the redo scan are the name filters since the redo will only apply to the names in the preview list. Therefore you could use the 'insert counter' pre-defined renaming to get an initial list, then you can arrange the list until you get the order that you want, and then redo the last scan. Redoing will cancel any manual edits that may have been made beforehand.

  • Row Positioning Buttons. Buttons are available for deleting selected rows, moving selected rows up, down, to the top of the list, or to the bottom of the list. There is also a button to randomly organize the rows.


Detailed Info Window Preview List

Preview List

The preview list shows which files/folders are to be renamed and information about the names.

Names can be added to the preview list by dragging them from an explorer window. When doing so, the renaming will be determined by applying the last scan-type used. If no scans have been done before dragging any names, then the default scan used will be the custom scan.

There are several formats available for displaying the information. The information is shown in a series of columns and rows. Rows are highlighted with different colours depending on whether the new names are OK, have an error, have a warning, or have been manually edited. Only columns that have been configured to be displayed will be shown.

  • The base pathname of the file/folder to be renamed.
  • The old or original name of the file/folder to be renamed.
  • Length indicator to show the length of the old name.
  • Length indicator to show the length of the full path of the old name.
  • The new name of the file/folder after renaming.
  • Length indicator to show the length of the new name.
  • Length indicator to show the length of the full path of the new name.
  • Change indicator to show whether the new filename is different from the old fileame.
  • Type indicator to show whether a name is a file or a folder.
  • Any problems detected with carrying out the renaming. The problems are prefixed by an indicator showing which error or warning message from the summary corresponds to the problem. Some examples of types of problems which are detected are when the new name is the same as an existing name, a new name will be the same as another new name, a new name will contain unprintable characters, or a new filename will contain characters not allowed by Windows (eg. '*', '<', '>', '\', '/', ':', '?'). The Problem column is only displayed if there are any problems detected. If there are no problems, the Problem column is not displayed.
  • "Last Modified Date' indicator to show when the file/folder was last modified.
  • "Creation Date' indicator to show when the file/folder was created.
  • "Last Accessed Date' indicator to show when the file/folder was last accessed.
  • "Size' indicator to show the size of the file (in bytes).
  • "Attribute' indicator to show various file/folder attributes.
    • An 'R' indicates that the file is read-only.
    • An 'H' indicates that the file is hidden.
    • An 'A' indicates that the archive attribute is set.
  • "DOS Name' indicates the shortened name of the file in a MS-DOS operating system.
  • "Email Information' columns corresponding to various text information meta-data as specified in the Email Options section.
  • "HTML Tag' columns corresponding to "Markup Language"-based text information tags. Only the title tag is supported.
  • "Hash' columns corresponding to hash values of files. Calculating hash values can take a very long time for large files. Therefore please be aware that display updates could be slowed down considerably when these columns are enabled.
  • "Music Information' columns corresponding to various text information meta-data as specified in the Music Options section. The Comments frame can also be displayed.
  • "Image Information' columns corresponding to various image information frames as specified in the Picture Options section. The Comments frame can also be displayed.
  • "Video Information' columns corresponding to various video information meta-data as specified in the Video Options section.
  • "Office Properties Information' columns corresponding to various Micorsoft office properties information meta-data as specified in the Office Properties Options section.

The new name column entries can be edited. Press F12 or Double click with the left mouse button on a new name entry to activate the editor; all the text will be pre-selected on entry. You can also press F11 to open the editor without pre-selecitng any text; the insertion point will be as specified by the 'Insertion Point' general display option. Enter the name changes and then use any of the following to save the entry:

  • press enter key (also closes the editor)
  • click the mouse outside the area being edited (also closes the editor)
  • press F12 (or F11), TAB, SHIFT-TAB, an up or down arrow, SHIFT-Home, or SHIFT-End (also keeps the editor open at the next entry)
Press ESC to exit the editor without saving.

When an edited entry is saved, the same validity checks that the scanner performs are done with the new entry.

Right clicking the mouse while the cursor is over any of the rows of the Detailed Information Window will make the following commands available in a popup menu:

  • Cancel Edit in Selected Row: This command allows you cancel the manual edit for a row.
  • Delete Selected Rows: This command allows you to delete all selected rows so that they will no longer be included in the renaming list.
  • Delete Selected Rows and Files: This command allows you to delete all selected rows so that they will no longer be included in the renaming list. the file or folder specified in "old name" will also be moved to the recycle bin.
  • Invert Selected Rows: This reverses which rows are selected and which ones are unselected.
  • Select All Rows: Selects all rows.
  • Move Selected Rows to the Top: This command allows you to move all selected rows to the top of the list. Multiple rows can be selected by pressing CTRL or SHIFT at the same time as pressing the left mouse button. This command is currently not supported in the 'Vertical Compare' display mode
  • Move Selected Rows to the Bottom: This command allows you to move all selected rows to the bottom of the list. Multiple rows can be selected by pressing CTRL or SHIFT at the same time as pressing the left mouse button. This command is currently not supported in the 'Vertical Compare' display mode
  • Move Selected Rows Up: This command allows you to move all selected rows up by one row position. Selected rows can also be moved up by dragging with the mouse. Multiple rows can be selected by pressing CTRL or SHIFT at the same time as pressing the left mouse button. This command is currently not supported in the 'Vertical Compare' display mode
  • Move Selected Rows Down: This command allows you to move all selected rows down by one row position. Selected rows can also be moved down by dragging with the mouse. Multiple rows can be selected by pressing CTRL or SHIFT at the same time as pressing the left mouse button. This command is currently not supported in the 'Vertical Compare' display mode
  • Randomize Position of All Rows: This command allows you move all rows to random positions.
  • Modify Comment Frame in Tag for Selected Files: Comments can be added to the comment frames of MP3 or EXIF tags. A meta-variable specifying the original file name can be inserted as part of the comment. There is no undo feature for this function. More details can be found in the dialog box that comes up when entering the comment text.
  • Modify File Properties for Selected Files: The Read-Only, Hidden, and Archive File attributes can be modified for currently selected files. This can be useful for making inaccessible files available for renaming. The 'Last Modified Date', 'Last Accessed Date', and 'Creation Date' can also be modified for currently selected files. There is no feature for undoing file property changes.
  • Open Old Name in Selected Row: This command allows you to open the 'old' file corresponding to the selected row. The user must already have the application used for opening the file installed on their PC. This feature can be used to verify that the file is really one that you want to rename. If more than one file is selected, only the first one will be opened. The same command can be accomplished by a left double click on a row.
  • Set Clipboard to 'Base Pathname' of Selected Rows: This commmand copies information from the 'Base Pathname' column of selected rows to the Windows clipboard. The data can then be pasted with the Windows 'Paste' command. This is useful for copying a pathname to the Main Window Current Folder Panel.
  • Set Clipboard to 'Old Name' of Selected Rows: This commmand copies information from the 'Old Name' column of selected rows to the Windows clipboard. The data can then be pasted with the Windows 'Paste' command. This is useful for copying an old filename to the Main Window Sample Name text area.
  • Set Clipboard to 'Old Name (with Base Pathname)' of Selected Rows: This commmand copies information from the 'Base Pathname' combined with the 'Old Name' columns of selected rows to the Windows clipboard. The data can then be pasted with the Windows 'Paste' command. This is useful for copying full pathnames to the Main Window Sample Name text area.
  • Set Clipboard to 'New Name' of Selected Rows: This commmand copies information from the 'New Name' column of selected rows to the Windows clipboard. The data can then be pasted with the Windows 'Paste' command.
  • Set Clipboard to 'Old Name' + 'New Name' of Selected Rows: This commmand copies information from the 'Old Name' and 'New Name' columns of selected rows to the Windows clipboard. The data can then be pasted with the Windows 'Paste' command.
  • Set Clipboard to 'Old Name (with Base Pathname)' + 'New Name' of Selected Rows: This commmand copies information from the 'Base Pathname' combined with 'Old Name' columns plus the 'New Name' columns of selected rows to the Windows clipboard. The data can then be pasted with the Windows 'Paste' command. <
  • Set Clipboard to Data from All Columns of Selected Rows: This commmand copies all the column data from selected rows to the Windows clipboard. The data can then be pasted with the Windows 'Paste' command.
  • Show Hex Codes of 'Old and New Names' in Selected Row: This command allows you view the hexadecimal codes of each character in the selected 'new' and 'old' names. The codes are displayed enclosed in parentheses after each character. Character-hexcode pairs are separated by spaces. The hex codes can be used in the search patterns of the custom renaming. e.g. setting the search pattern to \x63 (the hex code specifier for the character 'c') and the replace pattern to A will result in the scanner replacing all 'c's with 'A's

Right clicking the mouse while the cursor is over the column header of any column of the Detailed Information Window will make the following commands available in a popup menu:

  • Hide/Unhide: This set of commands lets you hide or unhide various columns or column groups. The hidden/unhidden columns are temporary. They are remembered during scan redo's but will reset back to their defaults when a new scan from the main window is performed. These commands are ignored when applied to the oldname and newname columns.
  • Set Column Widths to Default: This command sets all column widths to their default value. The column widths are preserved between PFrank sessions.
  • Call up the Options Window Column Configuration option panel.

Columns can be resized by dragging column boundaries with the mouse.


Detailed Info Window renaming Actions Panel

Renaming Actions Panel

Renaming actions can be invoked from this panel. Buttons are available for Renaming based on the renaming information shown in the detailed information panel or for Undoing the previous renaming. Note that editing the list or invoking a new scan after renaming will result in you not being able to undo the last renaming action.

The results of the renaming action will be shown in the detailed information window Status Bar and the main window Summary Panel. Names flagged with Errors will not be renamed. Names flagged with warnings will be renamed.

Most of the columns and the thumbnail displayed on the Detailed Information Window are based on the old name. After renaming, these display areas will be blanked out.

If SVN renaming has been enabled, the files/folders will be renamed as well as the corresponding names in the SVN repository. SVN renaming is very slow when compared to the regular (i.e. non-SVN) renaming mode. On a 1.7G Windows XP PC, the renaming rate is about 0.5 names/second (this is still much faster than doing the renaming manually). When doing bulk renaming with repositories, always make a backup!


Detailed Info Window Status Bar

Status Bar

The Status bar indicates extra information about menu commands, the state of any renaming in progress, the result of the last renaming action, the state of any find in progress, the result of the last find, the state of any batch file creation in progress, or the result of the last batch file creation.

  • Starting from the left, the first field shows extra information about a command available in the pull down menu but only when the mouse has selected the command. It also shows which row is selected out of how many rows are available, and the number of rows selected (but only if more than 1 is selected)
  • During renaming, the second field shows the number of renamed files, the total number of files to be renamed, and the number of any renaming failures.
    During a find, the second field shows the number of rows being searched and the result of the search indicating whether a matching row was found. The field reverts back to the last renaming result when the find dialog is closed.
  • When a renaming sequence is complete without errors, the total renaming time will be displayed in the third field. The total time will vary depending on what else is occurring on the PC while the scan or renaming is in progress. An abort indicator will be displayed if a renaming sequence is aborted by the user.
    During a batch file creation, the second field shows the number of renaming commands being added to the batch file and the final result. The field reverts back to the last renaming result when the confirmation dialog is closed.


Detailed Info Window SVN Panel

SVN Panel

The SVN (SubVersion) panel can be used when SVN renaming has been done and the SVN auto checkin feature has been disabled. This allows you to rename the SVN controlled files, ensure that the names are exactly the way you want (eg. compile your newly named source code), and then commit the changes using the SVN commit button.


Detailed Info Window Thumbnail Panel

Thumbnail Panel

If the selected file in the Detailed Information window is a picture file or if a mp3 file contains a picture, then a thumbnail of the picture will be displayed in this panel. The display can be disabled in the general options.

The thumbnail can be resized by moving the sash located in the blank area between the Thumbnail label and the preview list. Just move the mouse over the sash area and a double vertical arrow will appear. Left click on the arrow and drag to resize the thumbnail panel; the thumbnail will change size with the panel.


Keyboard Shortcuts

  • Main Window
  • Options Window
  • Detailed Information Window

Main Window

  • CTL-ALT-0, Abort a Scan (Can also use ESCAPE)
  • CTL-ALT-R, Reset all configurations to their Default Values

  • ALT-A, Display "About" Information
  • CTL-A, Select all rows of the custom list (when list is in focus).
  • CTL-B, Browse
  • ALT-D, Display "Detailed Information" Window
  • CTL-D, Display "Donation" Information
  • ALT-E, Erase Summary Panel
  • CTL-E, Edit User Defined Commands File
  • ALT-F, Pull Down File Menu
  • CTL-F, Flac Music File Scan
  • ALT-H, Pull Down Help Menu
  • CTL-H, Display "Hexadecimal Codes" Window
  • CTL-I, "Insert Pre-Defined Regex into Custom List
  • CTL-I, "Insert Pre-Defined Renaming Command into Custom List
  • CTL-K or CTL-SPACEBAR, Custom Scan
  • CTL-L, Load Configurations from a File
  • ALT-M, More Name Filters Option Window
  • CTL-M, MP3 Music File Scan
  • ALT-O, Display "Options" Window
  • CTL-O, Ogg Vorbis Music File Scan
  • CTL-P, Pre-Defined Renaming Scan
  • CTL-Q, Close Window {Quit}
  • ALT-R, Import Rename List
  • ALT-S, Save Summary To a File
  • CTL-S, Save Configurations to a File
  • ALT-T, Display "Tip of the Day"
  • CTL-T, Enable "Tool Tips"
  • CTL-U, Validate User Defined Commands File
  • ALT-V, Pull Down View Menu

  • ALT-1, Load Custom Settings Set
  • ALT-2, Save Custom Settings Set
  • ALT-3, Delete Custom Settings Set

  • CTL-UPARROW, Custom List Move Rows Up
  • CTL-DOWNARROW, Custom List Move Rows Down
  • CTL-DELETE, Custom List Delete Rows
  • CTL-HOME, Move Rows to the Top
  • CTL-END, Move Rows to the Bottom

  • ESCAPE, Abort a Scan (Can also use Ctl-Alt-0).
    ESCAPE also exits row edit mode and closes any subwindow (except Help Window).

  • F1, Activate Context Based Help of Selected Control.
  • ALT-F1, Display Built-in Help Documentation.
  • CTL-F2, Insert Row/Search/Replace summary type information from clipboard to custom list.
  • F3, Select Files Checkbox in Name Filter Panel.
  • F4, Select Folders Checkbox in Name Filter Panel.
  • F5, Check Selected rows in Custom Renaming Panel.
  • CTL-F5, Check All rows in Custom Renaming Panel.
  • F6, Uncheck Selected rows in Custom Renaming Panel.
  • CTL-F6, Uncheck All rows in Custom Renaming Panel.
  • SHIFT-F10, Display the Custom Renaming Panel row commands popup menu (same as right clicking over the panel) or if a cell in the custom list has been selected, then display the cell edit popup menu.
  • F11, Enter row edit mode in the custom list (same as double clicking on a row entry). No text wil be pre-selected.
  • F12, Enter row edit mode in the custom list (same as double clicking on a row entry). All text will be pre-selected
If the custom renaming list is in focus, then you can also use the following hot-keys:
  • DELETE, Delete selected rows from the custom list
  • INSERT, Insert a blank row into the custom list
  • CTL-Z, Undo/Redo the last row-based modification in the custom list

Options Window

  • CTL-A, Apply Options
  • ALT-C, Change Case
  • ALT-D, Display "Detailed Information" Window
  • CTL-D, Date Formatting
  • CTL-E, Email Insertion
  • ALT-F, Favourite Folders List
  • CTL-F, Parent Folder Name Insertion
  • ALT-G, General Display
  • CTL-G, General (Name Filters)
  • ALT-H, HTML Tag Information Insertion
  • CTL-H, Hash Information Insertion
  • ALT-I, Image IPTC Insertion
  • CTL-I, Force Case (All Words) - General
  • CTL-J, Force Case (Middle Words) - General
  • ALT-K, Column Display
  • CTL-K, OK Options
  • ALT-M, Display "Main" Window
  • CTL-M, Music Information Insertion
  • CTL-N, Counter Insertion {Number}
  • ALT-O, Office Properties Insertion
  • CTL-O, Miscellaneous Options
  • ALT-P, Favourite Filters List (Python Regex)
  • CTL-P, Picture (Image) Information Insertion
  • CTL-Q, Cancel Options & Close Window {Quit}
  • CTL-R, Replacement Commands
  • ALT-S, File Properties Insertion
  • CTL-S, Force Case (All Words) - Music
  • CTL-T, Force Case (Middle Words) - Music
  • ALT-U, Favourite Filters List (Unix Wildcard)
  • ALT-V, Video Insertion
  • ALT-W, Image GPS Insertion

  • ESCAPE, Closes the window.
  • F1, Activate Context Based Help of Selected Control.
  • ALT-F1, Display Built-in Help Documentation.

Detailed Information Window

  • CTL-ALT-0, Abort a Renaming/Undo sequence, or a Find in progress, or a batch file creation (Can also use ESCAPE)

  • CTL-A, Select all rows of the preview list (if list is in focus) (only available for sortable display)
  • CTL-C, Copy data in all rows to the clipboard (if list is in focus) (only available for sortable display)
  • CTL-D, ReDo Last Scan.
  • CTL-E, Export List to a CSV File
  • ALT-F, Pull Down File Menu
  • CTL-F, Find Text
  • ALT-M, Display "Main" Window
  • ALT-O, Display "Options" Window
  • CTL-P, Configure File Properties of Selected Files
  • CTL-Q, Close Window {Quit}
  • ALT-R, Create Renaming Batch File
  • CTL-R or CTL-SPACEBAR, Rename Files
  • ALT-S, Checkin all renamed SVN files.
  • CTL-S, Select Sortable Display Mode
  • ALT-U, Create Undo Batch File
  • CTL-U, Undo File Renaming
  • ALT-V, Pull Down View Menu
  • CTL-V, Select Vertical Display Mode

  • CTL-UPARROW, Move Rows Up (only available for sortable display)
  • CTL-DOWNARROW, Move Rows Down (only available for sortable display)
  • CTL-DELETE, Delete Rows (only available for sortable display)
  • CTL-HOME, Move Rows to the Top (only available for sortable display)
  • CTL-END, Move Rows to the Bottom (only available for sortable display)
  • CTL-F9, Randomize All Row Positions (only available for sortable display)

  • ESCAPE, Abort a ReScan or Find (Can also use Ctl-Alt-0). ESCAPE also either exits row edit mode or closes the window.

  • F1, Activate Context Based Help of Selected Control.
  • ALT-F1, Display Built-in Help Documentation.
  • F7, Decrease size of Thumbnail
  • F8, Increase size of Thumbnail
  • SHIFT-F10, Display the Detailed Information row commands popup menu (same as right clicking over the list)
  • F11, Enter row edit mode in the preview list (same as double clicking on the newname entry of a row). No text wil be pre-selected.
  • F12, Enter row edit mode in the preview list (same as double clicking on the newname entry of a row). All text will be pre-selected


Command Line

PFrank can be called from the Windows command line. In command line mode, you can run custom scans based on the saved custom lists from either the last current GUI session or from saved configuration files. The following options are available:

  • -h or -? . Display usage information for the command line interface.
  • -k. Use the saved configurations from the last GUI session to perform a custom scan and rename.
  • -o <log filename>. Save Details of the command line renaming including the names of all renamed files to the specified log file. This log file will also have the same summary information that you get when using the GUI. If no path is specified, the log file is created in the folder in which PFrank is executing. This option must be specified with -k or -L.
  • -L <configuration filename>. Preload the specified PFrank Config File (.pfr) and perform a custom scan and rename. .pfr files are created by invoking the Load command on the main window GUI of PFrank.
  • -v . Verbose mode. Output details of a custom scan to the Windows command line. Do not use this mode if running the command line mode as part of a periodic task. This option must be specified with -k or -L.

The renaming sequences/commands used must be preconfigured using the GUI. When -k or -L are specified a custom scan will run; any configurations last used by the GUI will remain unchanged. A folder argument can be specified with -k or -L resulting in the command using the specified folder as the current folder. The current configuration last used by the GUI will remain unchanged.

If PFrank is called with only a foldername argument, then the PFrank GUI will start with the current folder set to the foldername argument. This is the same way that PFrank is called when you right click on a windows folder and select PFrank.

Examples

  • C:\Program Files\PFrank\PFrank.exe -k can be used to do a custom scan and rename based on the most recent configuration of PFrank.
  • C:\Program Files\PFrank\PFrank.exe -k C:\Temp will do the same as the above but apply the scan and rename to items in the C:\Temp folder.
  • "C:\Program Files\PFrank\PFrank.exe" -L "C:\Documents and Settings\peter\Desktop\mynewconfig.pfr" will preload the configuration from the mynewconfig.pfr file and then perform the custom scan and rename. "C:\Program Files\PFrank\PFrank.exe" "C:\Documents and Settings\peter\Desktop"' will start the PFrank gui and set the current folder to the user's Desktop. Note that PFrank.exe must be specified with a full path in order for this to work.
  • "C:\Program Files\PFrank\PFrank.exe" "C:\Documents and Settings\peter\Desktop" will start the PFrank gui and set the current folder to the user's Desktop. Note that PFrank.exe must be specified with a full path in order for this to work.

Feedback is provided by starting up another command line session that displays any syntax errors, other errors, or additoinal information as provided by the -v option. Afterwards just press any key to eliminate the feedback window. If a command is successful, then the command just ends. If you want a summary of what was renamed, you can either use the log file option or the -v option.


User-Defined Commands

Power users can create your own renaming commands that when loaded, will appear at the end of the pre-defined command list of the main window. Details of how to load the commands are explained in the User Command Panel section. Sample commands and Details of the Python-based programming API are in the PFrankUser.py.template file found in the PFrank install folder.


Python-Style Regular Expressions

Regular Expressions

  • Introduction
  • Meta Character Basics
  • Using Meta Characters for Repeating Things
  • Using Meta Characters for Grouping
  • Using Meta Characters for Non-capturing and Named Groups
  • Using Meta Characters for Lookahead Assertions
  • Regex Flags
  • String Replacement
  • More Info

Introduction

A regular expression, usually abbreviated "re", "regex" or "regexp", is a language that describes text patterns. Regular Expressions are similar to unix style wildcards. except that regular expressions are much more powerful and the syntax is different.

Different styles of regex languages exist that are somewhat but not entirely compatible. Some examples are perl, python, and unix (sed, awk, grep, ksh, etc.).

PFrank supports python-style regular expressions for search pattern matching in the name filter patterns and in the custom renaming search patterns. In order to obtain a pattern match for a name, only part of the name needs to be matched.
Examples of regular expressions for matching with file/folder names are:

Search Pattern | Action
.* | Match filenames that have 0 or more occurrences of any character. This essentially finds all filenames.
\. | Match filenames that have a dot in it.
\.+ | Match filenames that sequences of dots where each sequence has one or more dots.
[^\.]*\.[.]{3,3}$ | Match filenames that have 0 or more occurrences of any character (other than a dot), followed by a dot, followed by 3 characters (other than a dot) at the end of the name. This finds all filenames with at least a 3 character extension.
a | Match filenames that have an 'a' in it.
abc | Match filenames that have 'abc' in it.
\.avi | Match filenames that have one or more occurrences of '.avi' in it.
\.avi$ | Match filenames that end in '.avi'.
\.(avi|mpg)$ | Match filenames that end in '.avi' or '.mpg'.
(?xi) .*[.](jpg|jpeg|gif)$ | Match filenames that end in '.jpg' or '.jpeg' or '.gif'. The letters can be lower or upper case.
^abc | Match filenames that start with 'abc'.
[0-9] | Match filenames that have a numerical digit.
[0-9][0-9]+ | Match filenames that have one or more occurrences of numerical digit sequences where each sequence has at least 2 digits.
^[0-9]{1-3}abc | Match filenames that start with 1-3 numerical digits followed by 'abc'.

PFrank supports python-style regular expressions for replacement pattern substitution when performing custom renaming. When specifying a replacement pattern string, the replacement string only replaces the portion(s) of the filename that was matched by the search pattern string.

Examples of regular expressions for matching filenames and then replacing them are:

Search Pattern | Replacement Pattern | Action
a | A | Replace all occurrences of the letter 'a' with 'A'.
a+ | a | Replace all multiple occurrences of the letter 'a' with a single letter 'a'.
abc | xyz | Replace all occurrences of the sequence 'abc' with 'xyz'.
%20 | _ | Replace all occurrences of the sequence '%20' with '_'.
abc |  | Delete all occurrences of abc. i.e. Replace all occurrences of abc with nothing.
[0-9] |  | Delete all occurrences of the numbers ranging from 0 to 9. i.e. Replace all occurrences of the numbers with nothing.
[aeiou] |  | Delete all occurrences of the letters 'a', 'e', 'i', 'o', or 'u'. i.e. Replace all vowels with nothing.
\(.*?\) |  | Delete all characters enclosed in parentheses (including the parentheses). i.e. Replace all occurrences with nothing.
(.*) | \1.jpg | Insert '.jpg' at the end of the name. The parentheses in '(.*)' of the search pattern identify a group in the regular expression search pattern. The first set of parentheses is group 1 and is referred to in the replacement pattern as '/1'. In this example, the entire filename is identified as group 1. To put a string after the group just set the replacement pattern to '\1' followed by the string you want to insert.
(.*) | Movie - \1 | Insert 'Movie - ' at the beginning of the name.
(\s)0{2,2}([0-9]+) | \1\2 | Delete 2 leading zeros from numbers that have at least 2 leading zeros. The search expression looks for whitespace followed by 2 zeros followed by any digits. The matching string is then replaced with the whitespace followed by the digits without the 2 leading zeros.
.{2,2}(.*) | abc\1 | Replace the first 2 characters of the filename with abc.
(.{64,64}).*?(\..*) | \1\2 | Take the first 64 characters of a filename prefix and add to the extension. Any characters between the first 64 and the extension are removed.
.(.{42,42}).*?(\..*) | \1\2 | Take the first 42 characters of a filename prefix and add to the extension. Any characters between the first 42 and the extension are removed.
.{2,2}(.*) | \1 | Delete the first 2 characters of the filename.
.{3,3}(.*) | \1 | Delete the first 3 characters of the filename.
(.*?){2,2}$ | \1 | Delete the last 2 characters of the filename.
([^\.]*?)\..{2,2}([^\.]*?)$ | \1.\2 | Delete first 2 characters of a filenames extension.
.{2,2}([^\.]*?)\.([^\.]*?)$ | \1.\2 | Delete first 2 characters of a filenames prefix.
([^\.]*?)\.([^\.]*?).{2,2}$ | \1.\2 | Delete last 2 characters of a filenames extension.
([^\.]*?).{2,2}\.([^\.]*?)$ | \1.\2 | Delete last 2 characters of a filenames prefix.
([^-]*?)-([^\.]*?)\.([^\.]*?)$ | \2-\1.\3 | Swap first 2 fields of a filename. In this case the name uses '-' as field separators and has only 2 fields before the extension.
(.+)\.(.+)\.(PF[0-9]+) | 1_\3.\2 | Move the third group (groups are enclosed in parentheses) after the first. Separate the third group from the first with an underscore character and separate the third from the second with a dot character. This can be used to move the suffix generated by the PFrank tool when it detects duplicates. The PF suffix in this case is moved to just before the extension of the filename.

From the above examples one can deduce that not all characters are interpreted literally but that some of them have special meaning. These types of characters are called meta characters. Here's a complete list of the metacharacters.

[ ] | ^ $ \ . * + ?  { } ( )
The following sections are a general tutorial on how to use regex expressions for string matching and for string replacement.

Meta Character Basics

Most letters and characters will simply match themselves. For example, the regular expression test will match the string "test" exactly.

There are exceptions to this rule; some characters are special, and don't match themselves. Instead, they signal that some out-of-the-ordinary thing should be matched, or they affect other portions of the regex by repeating them.

The "[" and "]" are used for specifying a character class, which is a set of characters that you wish to match. Characters can be listed individually, or a range of characters can be indicated by giving two characters and separating them by a "-". For example, [abc] will match any of the characters "a", "b", or "c"; this is the same as [a-c], which uses a range to express the same set of characters. If you wanted to match only lowercase letters, your regex would be [a-z]. Metacharacters are not active inside classes. For example, [akm$] will match any of the characters "a", "k", "m", or "$"; "$" is usually a metacharacter, but inside a character class it's stripped of its special nature. You can match the characters not within a range by complementing the set. This is indicated by including a "^" as the first character of the class; "^" elsewhere will simply match the "^" character. For example, [^5] will match any character except "5".

The "|" represents alternation, or the "or" operator. If A and B are regular expressions, A|B will match any string that matches either "A" or "B". | has very low precedence in order to make it work reasonably when you're alternating multi-character strings. Crow|Servo will match either "Crow" or "Servo", not "Cro", a "w" or an "S", and "ervo".

The "^" matches at the beginning of lines. For example, if you wish to match the word "From" only at the beginning of a line, the regex to use is ^From which would match the phrase 'From Here to Eternity' but will not match 'Reciting From Memory'.

The "$" matches at the end of a string. For example, End$ matches 'End' but does not match 'End '

The "\" is one of the most important metacharacters. It can be followed by various characters to signal various special sequences. It's also used to escape all the metacharacters so you can still match them in patterns; for example, if you need to match a "[" or "\", you can precede them with a backslash to remove their special meaning: \[ or \\. Depending on the regex style, some of the special sequences beginning with "\" represent pre-defined sets of characters that are often useful, such as the set of digits, the set of letters, or the set of anything that isn't whitespace. The following pre-defined special sequences are available:

Sequence | Meaning
\A | Matches only at the start of the string.
\b | Matches the empty string, but only at the beginning or end of a word. A word is defined as a sequence of alphanumeric characters, so the end of a word is indicated by whitespace or a non-alphanumeric character. Inside a character range, \b represents the backspace character.
\B | Matches the empty string, but only when it is not at the beginning or end of a word.
\d | Matches any decimal digit; this is equivalent to the set i [0-9].
\D | Matches any non-digit character; this is equivalent to the set [^0-9].
\s | Matches any whitespace character; this is equivalent to the set [ \t\n\r\f\v].
\S | Matches any non-whitespace character; this is equivalent to the set [^ \t\n\r\f\v].
\w | When the LOCALE and UNICODE flags (see Regex Flags) are not specified, matches any alphanumeric character; this is equivalent to the set [a-zA-Z0-9_]. With LOCALE, it will match the set [0-9_] plus whatever characters are defined as letters for the current locale. If UNICODE is set, this will match the characters [0-9_] plus whatever is classified as alphanumeric in the Unicode character properties database.
\W | When the LOCALE and UNICODE flags (see Regex Flags) are not specified, matches any non-alphanumeric character; this is equivalent to the set [^a-zA-Z0-9_]. With LOCALE, it will match any character not in the set [0-9_], and not defined as a letter for the current locale. If UNICODE is set, this will match anything other than [0-9_] and characters marked at alphanumeric in the Unicode character properties database.
\Z | Matches only at the end of the string.

These sequences can be included inside a character class. For example, [\s,|] is a character class that will match any whitespace character, or "," or "|".

The final metacharacter in this section is the period. It matches "any character".

Using Meta Characters for Repeating Things

Being able to match varying sets of characters is the first thing regular expressions can do that isn't already possible with the methods available on strings. However, if that was the only additional capability of regexes, they wouldn't be much of an advance. Another capability is that you can specify that portions of the re must be repeated a certain number of times.

The first metacharacter for repeating things that we'll look at is *. * doesn't match the literal character "*"; instead, it specifies that the previous character can be matched zero or more times, instead of exactly once.

For example, ca*t will match "ct" (0 "a"characters), "cat" (1 "a"), "caaat" (3 "a"characters), and so forth. The regex engine has various internal limitations stemming from the size of C's int type, that will prevent it from matching over 2 billion "a" characters; you probably don't have enough memory to construct a string that large, so you shouldn't run into that limit.

Repetitions such as * are greedy; when repeating a re, the matching engine will try to repeat it as many times as possible. If later portions of the pattern don't match, the matching engine will then back up and try again with few repetitions.

A step-by-step example will make this more obvious. Let's consider the expression a[bcd]*b. This matches the letter "a", zero or more letters from the class [bcd], and finally ends with a "b". Now imagine matching this re against the string "abcbd".

Step | Matched | Explanation
1 | a | The a in the regex matches.
2 | abcbd | The engine matches [bcd]*, going as far as it can, which is to the end of the string.
3 | Failure | The engine tries to match b, but the current position is at the end of the string, so it fails.
4 | abcb | Back up, so that [bcd]* matches one less character.
5 | Failure | Try b again, but the current position is at the last character, which is a "d".
6 | abc | Back up again, so that [bcd]* is only matching "bc".
6 | abcb | Try b again. This time but the character at the current position is "b", so it succeeds.

The end of the regex has now been reached, and it has matched "abcb". This demonstrates how the matching engine goes as far as it can at first, and if no match is found it will then progressively back up and retry the rest of the regex again and again. It will back up until it has tried zero matches for [bcd]*, and if that subsequently fails, the engine will conclude that the string doesn't match the regex at all.

Another repeating metacharacter is +, which matches one or more times. Pay careful attention to the difference between * and +; * matches zero or more times, so whatever's being repeated may not be present at all, while + requires at least one occurrence. To use a similar example, ca+t will match "cat" (1 "a"), "caaat" (3 "a"'s), but won't match "ct".

There are two more repeating qualifiers. The question mark character, ?, matches either once or zero times; you can think of it as marking something as being optional. For example, home-?brew matches either "homebrew" or "home-brew".

The most complicated repeated qualifier is {m,n}, where m and n are decimal integers. This qualifier means there must be at least m repetitions, and at most n. For example, a/{1,3}b will match "a/b", "a//b", and "a///b". It won't match "ab", which has no slashes, or "a////b", which has four.

You can omit either m or n; in that case, a reasonable value is assumed for the missing value. Omitting m is interpreted as a lower limit of 0, while omitting n results in an upper bound of a very large number.

You may have noticed that three other meta characters can all be expressed using this notation. For example, {0,} is the same as *, {1,} is equivalent to +, and {0,1} is the same as ?. It's better to use *, +, or ? when you can, simply because they're shorter and easier to read.

Using Meta Characters for Grouping

Frequently you need to obtain more information than just whether the regex matched or not. Regular expressions are often used to dissect strings by writing a regex divided into several subgroups which match different components of interest. For example, an RFC-822 header line is divided into a header name and a value, separated by a ":". This can be handled by writing a regular expression which matches an entire header line, and has one group which matches the header name, and another group which matches the header's value.

Groups are marked by the "(", ")" metacharacters. "(" and ")" have much the same meaning as they do in mathematical expressions; they group together the expressions contained inside them. For example, you can repeat the contents of a group with a repeating qualifier, such as *, +, ?, or {m,n}. For example, (ab)* will match zero or more repetitions of "ab".

Groups are numbered starting with 0. Group 0 is always present; it's the whole re. Subgroups are numbered from left to right, from 1 upward. Groups can be nested; to determine the number, just count the opening parenthesis characters, going from left to right. For example, in the pattern (a(b)c)d), the string 'abcd' matches as group 0, the string 'abc' matches as group 1, and the string 'b' matches as group 2

Backreferences in a pattern allow you to specify that the contents of an earlier capturing group must also be found at the current location in the string. For example, \1 will succeed if the exact contents of group 1 can be found at the current position, and fails otherwise. (\b\w+)\s+\1 is a regex that detects double words in a string. For example, it would match 'the the ' in the string 'Paris in the the spring'

The power of backreferences becomes especially apparent when they are specified in replacement patterns.

Using Meta Characters for Non-capturing and Named Groups

Elaborate regex's may use many groups, both to capture substrings of interest, and to group and structure the regex itself. In complex regex's, it becomes difficult to keep track of the group numbers. There are two features which help with this problem. Both of them use a common syntax for regular expression extensions, so we'll look at that first.

The sequence (?...) is used as a syntax extension. The characters immediately after the "?" indicate what extension is being used, so (?=foo) is one thing (a positive lookahead assertion) and (?:foo) is something else (a non-capturing group containing the subexpression foo).

A "P" following the question mark is an indication that it's an extension that's specific to Python. Currently there are two such extensions: (?P<name>...) defines a named group, and (?P=name) is a backreference to a named group.

Now that we've looked at the general extension syntax, we can return to the features that simplify working with groups in complex regex's. Since groups are numbered from left to right and a complex expression may use many groups, it can become difficult to keep track of the correct numbering, and modifying such a complex regex is annoying. Insert a new group near the beginning, and you change the numbers of everything that follows it.

First, sometimes you'll want to use a group to collect a part of a regular expression, but aren't interested in retrieving the group's contents. You can make this fact explicit by using a non-capturing group: (?:...), where you can put any other regular expression inside the parentheses.

Except for the fact that you can't retrieve the contents of what the group matched, a non-capturing group behaves exactly the same as a capturing group; you can put anything inside it, repeat it with a repetition metacharacter such as "*", and nest it within other groups (capturing or non-capturing). (?:...) is particularly useful when modifying an existing group, since you can add new groups without changing how all the other groups are numbered. It should be mentioned that there's no performance difference in searching between capturing and non-capturing groups; neither form is any faster than the other.

The second, and more significant, feature is named groups; instead of referring to them by numbers, groups can be referenced by a name.

The syntax for a named group is one of the Python-specific extensions: (?P<name>...). name is, obviously, the name of the group. Except for associating a name with a group, named groups also behave identically to capturing groups. Named groups are still given numbers, so you can retrieve information about a group in two ways. For example, to retrieve the first group of the search pattern

?P<word>\b\w+\b)

you can specify \1 or ?P<word>

Named groups are handy because they let you use easily-remembered names, instead of having to remember numbers. Here's an example for specifying a day - month - year pattern:

(?P<day>[ 123][0-9])-(?P<mon>[A-Z][a-z][a-z])-(?P<year>[0-9][0-9][0-9][0-9])
(?P<hour>[0-9][0-9]):(?P<min>[0-9][0-9]):(?P<sec>[0-9][0-9])

It's obviously much easier to refer to ,<min> instead of having to remember to retrieve group 5.

Since the syntax for backreferences, in an expression like (...)\1, refers to the number of the group there's naturally a variant that uses the group name instead of the number. This is also a Python extension: (?P=name) indicates that the contents of the group called name should again be found at the current point. The regular expression for finding doubled words, (\b\w+)\s+\1 can also be written as (?P<word>\b\w+)\s+(?P=word):

Lookahead Assertions

Another zero-width assertion is the lookahead assertion. Lookahead assertions are available in both positive and negative form, and look like this:

(?=...)
Positive lookahead assertion. This succeeds if the contained regular expression, represented here by ..., successfully matches at the current location, and fails otherwise. But, once the contained expression has been tried, the matching engine doesn't advance at all; the rest of the pattern is tried right where the assertion started.

(?!...)
Negative lookahead assertion. This is the opposite of the positive assertion; it succeeds if the contained expression doesn't match at the current position in the string.

An example will help make this concrete by demonstrating a case where a lookahead is useful. Consider a simple pattern to match a filename and split it apart into a base name and an extension, separated by a ".". For example, in "news.rc", "news"is the base name, and "rc" is the filename's extension.

The pattern to match this is quite simple:

.*[.].*$

Notice that the "." needs to be treated specially because it's a metacharacter; I've put it inside a character class. Also notice the trailing $; this is added to ensure that all the rest of the string must be included in the extension. This regular expression matches "foo.bar" and "autoexec.bat" and "sendmail.cf" and "printers.conf".

Now, consider complicating the problem a bit; what if you want to match filenames where the extension is not "bat"? Some incorrect attempts:

.*[.][^b].*$

The first attempt above tries to exclude "bat" by requiring that the first character of the extension is not a "b". This is wrong, because the pattern also doesn't match "foo.bar".

.*[.]([^b]..|.[^a].|..[^t])$

The expression gets messier when you try to patch up the first solution by requiring one of the following cases to match: the first character of the extension isn't "b"; the second character isn't "a"; or the third character isn't "t". This accepts "foo.bar" and rejects "autoexec.bat", but it requires a three-letter extension and won't accept a filename with a two-letter extension such as "sendmail.cf". We'll complicate the pattern again in an effort to fix it.

.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$

In the third attempt, the second and third letters are all made optional in order to allow matching extensions shorter than three characters, such as "sendmail.cf".

The pattern's getting really complicated now, which makes it hard to read and understand. Worse, if the problem changes and you want to exclude both "bat" and "exe" as extensions, the pattern would get even more complicated and confusing.

A negative lookahead cuts through all this:

.*[.](?!bat$).*$

The lookahead means: if the expression bat doesn't match at this point, try the rest of the pattern; if bat$ does match, the whole pattern will fail. The trailing $ is required to ensure that something like "sample.batch", where the extension only starts with "bat", will be allowed.

Excluding another filename extension is now easy; simply add it as an alternative inside the assertion. The following pattern excludes filenames that end in either "bat" or "exe":

.*[.](?!bat$|exe$).*$

Regex Flags

Regex flags let you modify some aspects of how regular expressions work. Below is a table of the available flags with detailed explanations. Some of the flags which deal with interpretation of the newline character do not apply to the PFrank pattern specifiers since only one-line patterns are supported. These flags are prefixed with an asterisk in the descriptions and are only included for completeness.

For example, here's an regex that can be used when the verbose flag is set:

[0-9]+[^0-9] | x[0-9a-fA-F]+[^0-9a-fA-F]   # Decimal or Hexadecimal format

Without the verbose setting, the regex would look like this:

[0-9]+[^0-9]|x[0-9a-fA-F]+[^0-9a-fA-F]

Flag | Meaning
i | IGNORECASE: Perform case-insensitive matching; character class and literal strings will match letters by ignoring case. For example, [A-Z] will match lowercase letters, too, and Spam will match "Spam", "spam", or "spAM". This lowercasing doesn't take the current locale into account; it will if you also set the LOCALE flag.
L | LOCALE: Make \w, \W, \b, and \B, dependent on the current locale. Locales are a feature of the C library intended to help in writing programs that take account of language differences. For example, if you're processing French text, you'd want to be able to write \w+ to match words, but \w only matches the character class [A-Za-z]; it won't match "é" or "ç". If your system is configured properly and a French locale is selected, certain C functions will tell the program that "é" should also be considered a letter. Setting the LOCALE flag when compiling a regular expression will cause the resulting compiled object to use these C functions for \w; this is slower, but also enables \w+ to match French words as you'd expect.
u | UNICODE: Make \w, \W, \b, \B, dependent on the unicode locale.
x | VERBOSE: Enable verbose regex's, which can be organized more cleanly and understandably. This flag allows you to write regular expressions that are more readable by granting you more flexibility in how you can format them. When this flag has been specified, whitespace within the regex pattern is ignored, except when the whitespace is in a character class or preceded by an unescaped backslash; this lets you organize and indent the regex more clearly. It also enables you to put comments within a regex that will be ignored by the engine; comments are marked by a "#" that's neither in a character class or preceded by an unescaped backslash.
B | BUILD PATH: This is a PFrank extension. It is used to make the renamer allow the use of the forward slash character in the replace pattern. When renaming occurs, the new name is treated as a path to a file. Folders are created from the current folder down to the leaf filename. eg. a new name of 2006/06/28/picture01 will result in the folder '2006' created under the current folder, the folder '06' created under '2006, the folder '28' created under '06' and the file picture01 located in the '28' folder. Once the flag is used, it will apply to all remaining columns in the custom renaming list. The use of the flag will be disabled when Subversion (SVN) mode is enabled.
E | EXCLUDE EXTENSION: This is a PFrank extension. It is used to make the renamer ignore the extension of a filename.
Z | POST PROCESSING: This is a PFrank extension. It is used to delay the renaming expression until after the duplication checking (assuming duplication checking is enabled).
1-4 | MATCH COUNT: This is a PFrank extension. It is used to make the renamer make up to 'n' replacements in a name, where 'n' = 1, 2, 3, or 4. Only one digit at a time can be used in the flag group.

"(?iLuxEBZ2)" is an example of the extension notation used to indicate which of the flags "i", "L", "u", "x", "B", "E", "Z", or "1-4" are to be set. The '2' flag is shown in the example as an instance of the 'MATCH COUNT' flag). The flag group itself matches the empty string.

Example usage:

(?xi)\.mp3 # matches the extension in mp3 files
is used to ignore letter cases when matching ".mp3" extensions.

(?x1)a # matches the first "a" in the names "abba" or "aardvark"
is used to ignore all 'a's after the first one.

(?2i)e
is used to match the first 2 'e's in a name like "Ed Meets the Beatles".

(?E)3
is used to match the number '3' unless it appears in an extension like "mp3" or ".m3a".

(?3x1)The
will result in an error since more than 1 digit is present in the flag specifier.

Note that the (?x) flag group changes how the expression is parsed. It must be the first set of characters in the expression string. If there are any characters before the flag group, then the flags will not work. Only one flag group can be used in an expression! If there is more than one group (eg. (?i)The(?3)(?1)(?E), then the results are undefined.

String Replacement

Once a search pattern is specified, one can then specify a replacement pattern which is used to replace any matching strings found. Below are some examples:

Search Pattern | Matching String Before Replacement | Replace Pattern | String after Replacements
abc | abcdefgabcabc | xyz | xyzdefgxyzxyz
(blue|white|red) | blue socks and red shoes | colour | colour socks and red shoes
x* | abxd | - | -a-b-d-
abc*yz | abcccccyz | wx | wxyz

If the replacement pattern is a string, any backslash escapes in it are processed. That is, "\t" is converted to a tab character, "\r" is converted to a carriage return, and so forth. Unknown escapes such as "\j" are left alone. Backreferences, such as "\6", are replaced with the substring matched by the corresponding group in the re. This lets you incorporate portions of the original text in the resulting replacement string.

This example matches the word "section" followed by a string enclosed in "{", "}", and changes "section" to "subsection":

Search Pattern | Matching String Before Replacement | Replace Pattern | String after Replacements
section{ ( [^}]* ) } | section{First} section{second} | subsection{\1} | subsection{First} subsection{second}

When performing string replacements, the syntax for backreferencing to named groups (as defined by the (?P<name>...) syntax) is as follows. "\g<name>" uses the substring matched by the group named "name", and "\g<number>" uses the corresponding group number. "\g<2>" is therefore equivalent to "\2", but isn't ambiguous in a replacement string such as "\g<2>0". ("\20" would be interpreted as a reference to group 20, not a reference to group 2 followed by the literal character "0".) The following substitutions are all equivalent, but use all three variations of the replacement string.

Search Pattern | Matching String Before Replacement | Replace Pattern | String after Replacements
section{ (?P<name> [^}]* ) } | section{First} | subsection{\1} | subsection{First}
section{ (?P<name> [^}]* ) } | section{First} | subsection{\g<1>} | subsection{First}
section{ (?P<name> [^}]* ) } | section{First} | subsection{\g<name>} | subsection{First}

More Info

For complete information on Python-style regular expressions see the Python Library Reference:
http://www.python.org/doc/2.3/lib/re-syntax.html/.

or visit the web sites listed on the PFrank Web Site at: .
http://www3.telus.net/pfrank/PFrankRegexLinks.html.


Unix Wildcards

Wildcards

Wildcards are used to match string patterns. They are similar to regular expressions except regular expressions are much more powerful and the syntax is different.

Different styles of wildcard formats exist that are somewhat but not entirely compatible. Some examples are Unix and DOS (Windows). PFrank supports Unix style wildcards.

The special characters used for Unix style wildcard matching in this product are:

Pattern | Meaning
* | matches everything
? | matches any single character
[ ] | matches any character or range of characters specified between the brackets
[ ! ] | matches any character not matching the characters or range of characters specified after the exclamation point

Initially, people can get confused between wildcards and regular expressions. As mentioned above, the symbols used for wildcards have somewhat different meanings when used for regular expressions. One difference is that * means "anything" in file name wildcards, whereas * means "zero or more of the preceding character" in regular expressions. Also, ? in file name wildcards is similar to . in regular expressions. In wildcards, the period just stands for itself.

Below are some examples.

*
* finds file names with zero or more occurrences of any character. This pattern can be used to match all filenames.
*.*
*.* finds file names with zero or more occurrences of any character, followed by a "." (i.e. dot), followed by zero or more occurrences of any character. This pattern can be used to find all filenames with a dot extension.
*.???
*.??? finds file names with zero or more occurrences of any character, followed by a "." (i.e. dot), followed by three occurrences of any character. This pattern can be used to find all filenames with three character dot extensions.
*.jpg
*.jpg finds file names with zero or more occurrences of any character, followed by a "." (i.e. dot), followed by the character string "jpg". This pattern can be used to find jpeg files
Q*
Q* finds file names beginning with a capital Q followed by zero or more occurrences of any other character.
Q[a-z]*
Q[a-z]* finds file names beginning with a capital Q followed by one lower case alphabetic character, followed by zero or more other characters of any kind.
Q[!a-z]*
Q[!a-z]* finds file names beginning with a capital Q followed by anything other than a lower case alphabetic character, followed by zero or more other characters of any kind.
Q[uU]*y
Q[uU]*y finds file names beginning with a capital Q, followed by one capital or lower case u, followed by zero or more of anything else, and ending with a lower case y.
file?
file? finds file names beginning with file followed by exactly one character. If instead, you specified file by itself, that would give you a file named file. Or if you specified file*, you'd find file names starting with file followed by 0 or more occurrences of other characters.


Advanced Renaming

Advanced Renaming topics include the following categories:

  • Swapping Fields
  • Creating Folder Paths from Names
  • Add Meta Data and Counters
  • Create Your Own Renaming Commands
  • Post Processing Renaming

Swapping Fields

Swapping fields of a name can be done easily in the custom renaming panel with regular expressions. If for example you have filenames of the form:

artist - title - album.mp3

where the fields for artist, title, and album are separated by dashes and you want to change this to:

title - album - artist.mp3

What you have to do is isolate the fields into groups. Each group in a regex is surrounded by parentheses. In this case you would put the following into the search column:

(.*?)-(.*?)-(.*?).mp3

This pattern has three groups. Group 1 is the artist field, Group 2 is the title field, and group 3 is the album field. Group 1 matches any character up to the first dash character. The dash is not included in the group. Group 2 matches any characters between the first dash and second dash. Again the dashes are not included in the group. Group 3 matches any characters between the second dash and the .mp3. the second dash and the .mp3 are not included in the group.

In the replace column you identify group 1 (artist) as \1, group 2 (title) as \2, and group 3 (album) as \3. If you wanted the new name to be of the form: title - album - artist

then you would specify:

\2 - \3 - \1.mp3

You will probably end up with extra whitespace around the dashes but that can be cleaned up by putting a "Delete All Extra Whitespace in Prefix" command into the next row.

Creating Folder Paths from Names

Creating a hierarchy of folder paths from parts of a name can be done easily in the custom renaming panel with regular expressions. You have to use the BUILD PATH regular expression PFrank extension flag (see Regex Flags section). If for example you have the following filenames:

Report1 123-00.xls
Report1 123-01.xls
Report1 123-02.xls
Report1 123-03.xls
Report2 212-00.xls
Report2 212-01.xls
Report2 212-02.xls
Report2 212-03.xls
Report3 215-00.xls
Report3 215-01.xls
Report3 215-02.xls
Report3 215-03.xls

And you would like to put them in a folder structure like this:

/MyReport1
        /123
            /00.xls
            /01.xls
            /02.xls
            /03.xls
/MyReport2
        /212
            /00.xls
            /01.xls
            /02.xls
            /03.xls
/MyReport3
        /215
            /00.xls
            /01.xls
            /02.xls
            /03.xls

This is what you do. In the search column identify the different groups by entering this:

(Report[0-9]+?) ([0-9]+?)-([0-9]+?.xls)

There are 3 sets of parentheses identifying the 3 different groups. Next you prefix the pattern with a regex flag. The flag used is 'B' which is a special PFrank extension. Thus you now have:

(?B)(Report[0-9]+?) ([0-9]+?)-([0-9]+?).xls

The flag modifies the illegal character checking in the replacement pattern so that the forward slash character is allowed. In the replace column you would specify:

My\1/\2/\3

The forward slashes identify where the folder boundaries are. When you carry out the renaming, a folder identified by group 1 will be created in the current folder, a folder identified by group 2 will be created under the group 1 folder, and a filename identified by group 3 will be created under the group 2 folder.
e.g. Report3 215-03.xls will be converted to MyReport3\215\03.xls where the Report3 folder will be created under the current folder.

This feature is automatically disabled when SubVersion (SVN) mode is enabled.

Add Meta Data and Counters

Below is an example custom sequence for Adding date/time and picture size information to a set of photo files. The file names are:

IMG_0014.jpg
IMG_0016.jpg
IMG_0017.jpg
IMG_0022.jpg
IMG_0031.jpg
You would like to change the names to the following form:
Vacation_<counter>_<Date> size(<height>x<width>).jpg

An example is below:

Vacation_0001_(Sunday January 01,2006) size(1983x2754).jpg
Vacation_0001_(Sunday January 01,2006) size(2208x3071).jpg
Vacation_0001_(Sunday January 01,2006) size(2698x2300).jpg
Vacation_0001_(Sunday January 02,2006) size(1983x2754).jpg
Vacation_0001_(Sunday January 02,2006) size(2698x2300).jpg
Vacation_0001_(Sunday January 02,2006) size(2208x3071).jpg
This can be done using the custom renaming as follows:
Row: 1
   Search:  'IMG_[0-9]+'
   Replace: ''
Row: 2
   Search:  '.jpg'
   Replace: 'Vacation.jpg'
Row: 3
   Search:  ''
   Replace: '*Insert Counter after*Prefix*'
Row: 4
   Search:  ''
   Replace: '*Insert Image Information after*Prefix*'
       Custom Format String for Insertion:
            '(%DateTime%) size(%Width%x%Height%)'
The first row strips everything away except the extension.
The second row adds the word 'Vacation' before the extension
The third row adds a counter after the word 'Vacation'
The fourth row adds date/time, height, and width meta data. The date time format is configured using the 'Data Formatter' on the options window.

Create Your Own Renaming Commands

You can create your own renaming commands that when loaded, will appear at the end of the pre-defined command list of the main window. Details of how to load the commands are explained in the User Command Panel section. Sample commands and Details of the Python-based programming API are in the PFrankUser.py.template file found in the PFrank install folder.

Post Processing Renaming

Some users deliberately use the duplicate renaming resolver to add resolving strings to their names but the resolving names are not exactly what they want. With the post processsing feature, you can configure some renaming to be done after the duplicate name resolution phase. Post processing can ony be used with regular expressions in the custom renaming list. This is accomplished by using the POST PROCESSING regular expression PFrank extension flag (see Regex Flags section).

An example is shown below (it is assumed that the duplication resolver is configiured to add a counter after the name prefix):

Row: 1
   Search:  '.*\.jpg'
   Replace: 'Photo # Vacation.jpg'
Row: 2
   Search:  '(?Z)(.{7,7})(.*?)([0-9]+.)jpg'
   Replace: '\1\3\2.jpg'

Row 1 will produce many duplicates which will be resolved by PFrank by adding a number at the end of the prefix. Row 2 is executed after the duplicate name resolver as part of the post processing phase. The post processing takes the number that was added at the end of the name prefix, and moves it after the # character in the prefix. Note that another phase of name duplication resolution will take place after the post processing in case there are still duplicate names.


PFrank Free License Agreement
END-USER LICENSE AGREEMENT FOR FREEWARE

Except where otherwise noted, all of the documentation and software included in
the PFrank Setup package is copyrighted by Peter Frankenberger.

IMPORTANT - READ CAREFULLY: This License Agreement is a legal agreement
between you (either an individual or a single entity) and Peter Frankenberger for the
PFrank software product identified above, which may include associated
software components, media, printed materials, and "online" or electronic
documentation ("Software"). By installing, copying, or otherwise using the Software,
you agree to be bound by the terms of this Agreement. If you do not agree to the
terms of this Agreement, do not install or use the Software.

FREEWARE LICENSE

This Software is being distributed as Freeware. It may be freely used, copied
and distributed as long as it is not sold, and all original files are included,
 including this license. You are NOT allowed to make a charge for distributing this
Software (either for profit or merely to recover your media and distribution costs)
whether as a stand-alone product, or as part of a compilation or anthology, without
explicit prior written permission. By using this Software, you agree to these
terms and the terms of the Disclaimer below:

DISCLAIMER

This Software and any support from Peter Frankenberger are provided "AS IS" and
without warranty, express or implied. Peter Frankenberger specifically disclaims
any implied warranties of merchantability and fitness for a particular purpose.
In no event will Peter Frankenberger be liable for any damages, including but not
limited to any lost profits, lost savings or any incidental or consequential
damages, whether resulting from impaired or lost data, software or computer
failure or any other cause, or for any other claim by the user or for any third
party claim.


Peter's Flexible RenAmiNg Kit (PFrank)

Version 2.02

Copyright (c) 2004, 2005, 2006, 2007 by Peter Frankenberger


Grouping

The grouping feature allows meta-data information found from one file to be used in renaming other files that have the same filename prefix. Note that in order for this to work, the source of the meta data information must be the first one scanned in the group. This can only be done if the source file is alphabetically first. e.g. If you have the files 'abc.jpg' and 'abc.nef', then the grouping function will take the image information from the jpg file and insert it simultaneously into the abc.jpg and abc.nef filenames.

If the filenames were abc.crw and abc.jpg, then the grouping will not work because abc.jpg is alphabetically after abc.crw and will be scanned first. Since the .crw is scanned first and meta data cannot be read from the crw file, none of the files in the group will have any meta-data inserted into their filenames. One simple work-around for this case is to scan anyway, then resort the 'old names' in the preview list in reverse order. This should position all the .jpg files before the equivalent .crw files. Then press the rescan button and the grouping will work.
if resorting by column does not provide the desired order, then you can either resort manually or you could first rename the files that are the src of the meta-data to something with say .aaa extensions. Then run PFrank again using the grouping (in which case you can then also change the .aaa suffix back to the original suffix).


PFrank is a bulk file renaming utility.  It can be used to rename
files using regular expressions or pre-defined renaming commands.
The predefined renaming commands allow letter case translation and insertion
of counters, dates, parent folder names, file properties information,
tag information or other meta-data from music files, image files, HTML (or
other Markup Language) files, email files, microsoft office files, or video
files.  You can also define your own predefined commands!

The use of regular expressions for renaming is extremely powerful.  This
tool allows you to run not one, but a series of regular-expression based
search/replace actions.  You define the search/replace actions and you
choose the sequence!  You can also add the pre-defined renaming commands
into the sequence list.  The list can be saved during your session for later
reloading.  Any number of lists can be saved.  The lists can be managed with
a list manager.

All current configuration settings are saved between sessions.  All settings
can be saved into personal configuration files.  All settings can be loaded
from the configuration files.

Specialized renaming is also available for music files.  This can be used
to give all your music files consistent naming.  For example, depending on
how the music files were created, they may use different letter cases for
the filename prefix or extension, different delimiters for field separation,
different bracketing characters, different conventions for whitespace, etc.
With one command many different types of inconsistencies will be corrected.
Each aspect of the renaming can be optionally disabled.

When PFrank is run, a current folder is selected by the user which can then
be filtered and scanned for files/folders to rename.  Subfolders can also be scanned
if desired.  When a search for files to be renamed is completed, the tool
will have produced an internal list of renaming commands.  The internal list
is used later to carry out the renaming.

PFrank produces errors if new names will be renamed to the same name as
already existing files or if new names will be renamed to the same name as
other new names.  In such cases, the internal list will be stripped of the
invalid renaming sequences.  There is an option available to automatically
resolve the naming conflicts, however, it would be wise to clean up any
such warnings manually beforehand.

PFrank produces errors if new names contain unprintable characters or
invalid Windows filename characters.  This is possible when using regular
expressions or when inserting tags from file headers. In such cases, the
internal list will be stripped of the invalid renaming sequences.  It is
left to the user to correct the source of the problem so that the invalid
characters are not produced in the new names.

PFrank produces errors if new names (including path) are longer than 256
characters. This is a Windows limitation.  In such cases, the internal list
will be stripped of the invalid renaming sequences.

PFrank produces warnings if tags are not found during tag insertion.   It
can be configured to instead produce errors or just ignore the missing tag.

The user can preview the renaming to ensure that no unintentional renaming
will occur.  The previewer also includes any of the file information or meta-
data used during the insertion.  The columns of meta data can be managed
using a sophisticated column manager.
The previewer also shows all information about any errors or warnings that
were detected during the scan.  If there is some unintentional renaming
specified, then the user can either correct the renaming manually or simply
rerun the scan with appropriate modifications.  Once satisfied with the
preview result, the user can carry out the renaming.

If for some reason, renaming is performed but the names need to be converted
back to their original names, there is a command available for undoing the
previous renaming.

Renaming and Undo DOS-style batch files can also be created if desired.  A
command-line interface that has the same renaming capability as the GUI is
also available.

Use the many options which are available for customizing and enhancing your
renaming experience!